Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge with ezxml library #38

Merged
merged 9 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 0 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,11 @@ jobs:
# specify the version you desire here
- image: matthewjamesbriggs/mxci:v001

resource_class: xlarge
working_directory: ~/mx

steps:
- checkout

# Download and cache dependencies
# - restore_cache:
# keys:
# - iqcache-{{ checksum ".circleci/cache-lock" }}-{{ checksum "iqtestdata/.cache-lock" }}
# # fallback to using the latest cache if no exact match is found
# - iqcache-

# - run: yarn install --cache-folder ~/yarn-cache

# - run:
# name: Install Git LFS
# command: |
# curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
# sudo apt-get update
# sudo apt-get install -y git-lfs openssh-client
# git lfs install
# mkdir -p ~/.ssh
# ssh-keyscan -H github.com >> ~/.ssh/known_hosts
# ssh git@github.com git-lfs-authenticate "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" download
# git lfs pull

# - save_cache:
# paths:
# - node_modules
# - iqtestdata
# - web/node_modules
# - iqbak/node_modules
# - iqshared/node_modules
# - ~/yarn-cache

# key: iqcache-{{ checksum ".circleci/cache-lock" }}-{{ checksum "iqtestdata/.cache-lock" }}

- run:
name: Cmake
command: |
Expand Down
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ file(GLOB_RECURSE SRC_MX_CORE ${PRIVATE_DIR}/mx/core/*.c* ${PRIVATE_DIR}/mx/core
file(GLOB_RECURSE SRC_MX_IMPL ${PRIVATE_DIR}/mx/impl/*.cpp ${PRIVATE_DIR}/mx/impl/*.h)
file(GLOB_RECURSE SRC_MX_PUGIXML ${PRIVATE_DIR}/mx/pugixml/*.cpp ${PRIVATE_DIR}/mx/pugixml/*.hpp)
file(GLOB_RECURSE SRC_MX_UTILITY ${PRIVATE_DIR}/mx/utility/*.cpp ${PRIVATE_DIR}/mx/utility/*.h)
file(GLOB_RECURSE SRC_MX_XML ${PRIVATE_DIR}/mx/xml/*.cpp ${PRIVATE_DIR}/mx/xml/*.h)
file(GLOB_RECURSE SRC_MX_EXTERN ${PRIVATE_DIR}/extern/*.cpp ${PRIVATE_DIR}/extern/*.h)

file(GLOB_RECURSE SRC_MX_TEST_API ${PRIVATE_DIR}/mxtest/api/*.cpp ${PRIVATE_DIR}/mxtest/api/*.h)
file(GLOB_RECURSE SRC_MX_TEST_CONTROL ${PRIVATE_DIR}/mxtest/control/*.cpp ${PRIVATE_DIR}/mxtest/control/*.h)
Expand All @@ -32,23 +32,25 @@ file(GLOB_RECURSE SRC_MX_TEST_IMPL ${PRIVATE_DIR}/mxtest/impl/*.cpp ${PRIVATE_DI
file(GLOB_RECURSE SRC_MX_TEST_CORE ${PRIVATE_DIR}/mxtest/core/*.cpp ${PRIVATE_DIR}/mxtest/core/*.h)
file(GLOB_RECURSE SRC_MX_TEST_IMPORT ${PRIVATE_DIR}/mxtest/import/*.cpp ${PRIVATE_DIR}/mxtest/import/*.h)
file(GLOB_RECURSE SRC_MX_TEST_UTILITY ${PRIVATE_DIR}/mxtest/utility/*.cpp ${PRIVATE_DIR}/mxtest/utility/*.h)
file(GLOB_RECURSE SRC_MX_TEST_XML ${PRIVATE_DIR}/mxtest/xml/*.cpp ${PRIVATE_DIR}/mxtest/xml/*.h)
#file(GLOB_RECURSE SRC_MX_TEST_XML ${PRIVATE_DIR}/mxtest/xml/*.cpp ${PRIVATE_DIR}/mxtest/xml/*.h)
file(GLOB_RECURSE SRC_CPUL ${PRIVATE_DIR}/cpul/*.cpp ${SOURCE}/cpul/*.h)

# Mx Library
add_library(Mx STATIC ${SRC_MX_API} ${SRC_MX_CORE} ${SRC_MX_IMPL} ${SRC_MX_PUGIXML} ${SRC_MX_UTILITY} ${SRC_MX_XML})
add_library(Mx STATIC ${SRC_MX_API} ${SRC_MX_CORE} ${SRC_MX_IMPL} ${SRC_MX_PUGIXML} ${SRC_MX_UTILITY})
source_group( "api-public" FILES ${HEADERS_MX_API})
source_group( "api" FILES ${SRC_MX_API} )
source_group( "core" FILES ${SRC_MX_CORE} )
source_group( "impl" FILES ${SRC_MX_IMPL} )
source_group( "pugixml" FILES ${SRC_MX_PUGIXML} )
source_group( "utility" FILES ${SRC_MX_UTILITY} )
source_group( "xml" FILES ${SRC_MX_XML} )
source_group( "extern" FILES ${SRC_MX_EXTERN} )
set_property(TARGET Mx PROPERTY CXX_STANDARD 14)

target_include_directories(Mx PUBLIC ${PUBLIC_DIR})
target_include_directories(Mx PRIVATE ${PRIVATE_DIR})

add_subdirectory("${PRIVATE_DIR}/extern/ezxml")
target_link_libraries(Mx ezxml)
target_include_directories(Mx PRIVATE "${PRIVATE_DIR}/extern/ezxml/src/include")

file(WRITE ${PRIVATE_DIR}/mxtest/file/PathRoot.h
"// This file is auto generated by CMake
Expand Down Expand Up @@ -80,6 +82,7 @@ if(MX_BUILD_TESTS)
find_package( Threads )
add_executable(MxTest ${SRC_MX_TEST_API} ${SRC_MX_TEST_CONTROL} ${SRC_MX_TEST_CORE} ${SRC_MX_TEST_FILE} ${SRC_MX_TEST_IMPL} ${SRC_MX_TEST_IMPORT} ${SRC_MX_TEST_UTILITY} ${SRC_MX_TEST_XML} ${SRC_CPUL})
target_include_directories(MxTest PRIVATE ${PRIVATE_DIR})
target_include_directories(MxTest PRIVATE "${PRIVATE_DIR}/extern/ezxml/src/include")
target_link_libraries(MxTest Mx)
target_link_libraries(MxTest ${CMAKE_THREAD_LIBS_INIT})
set_property(TARGET MxTest PROPERTY CXX_STANDARD 14)
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ The MusicXML classes are tightly bound to the musicxml.xsd specification. Music

```
using namespace mx::core;
using namespace mx::xml;
using namespace ezxml;
using namespace mx::utility;
```

The `mx::core` namespace contains the MusicXML representation objects such as elements and attributes. 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.

The `mx::xml` namespace contains generic XML DOM functionality. Under the hood [pugixml](http://pugixml.org/) is being used. See the XML DOM section for more information.
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.

The `mx::utility` namespace contains the beginnings of an api for simplifying the interactions with MusicXML. This namespace and its interfaces will change completely and should be avoided for now.

Expand Down Expand Up @@ -528,20 +528,20 @@ private:

When `getChoice() == BendChoice::Choice::preBend` then we will see `<pre-bend/>` in the XML, but when `getChoice() == BendChoice::Choice::postBend` then we will see `<post-bend/>` in the XML.

### XML DOM (mx::xml)
### XML DOM (::ezxml::)

Any XML document can be read and manipulated with the classes in the `mx::xml` 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.

Here's how you can read a MusicXML document into `mx::core` classes by way of `mx::xml`.
Here's how you can read a MusicXML document into `mx::core` classes by way of `::ezxml::`.

```
#include "mx/core/Document.h"
#include "mx/utility/Utility.h"
#include "functions.h"
#include "mx/xml/XFactory.h"
#include "mx/xml/XDoc.h"
#include "ezxml/XFactory.h"
#include "ezxml/XDoc.h"

#include <iostream>
#include <string>
Expand All @@ -551,7 +551,7 @@ int main(int argc, const char *argv[])
{
// allocate the objects
mx::core::DocumentPtr mxDoc = makeDocument();
mx::xml::XDocPtr xmlDoc = mx::xml::XFactory::makeXDoc();
::ezxml::::XDocPtr xmlDoc = ::ezxml::::XFactory::makeXDoc();

// read a MusicXML file into the XML DOM structure
xmlDoc->loadFile( "music.xml" );
Expand Down Expand Up @@ -684,8 +684,8 @@ Each of these test input files has been "scrubbed" using the XDoc classes (i.e.

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 mx::xml 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.
**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.
**Historical Note: June 20, 2016:** The GitHub repo was bloated and has been entirely wiped-out and restarted.
12 changes: 12 additions & 0 deletions Sourcecode/private/extern/ezxml/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.a filter=lfs diff=lfs merge=lfs -text
*.dylib filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
Loading