Skip to content

Commit

Permalink
coda-oss release 2021-12-13
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Dec 13, 2021
1 parent 86c1856 commit ef19ad2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
2 changes: 2 additions & 0 deletions externals/coda-oss/cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ These options may be passed in the cmake configure step as `-DOPTION_NAME="optio
|BUILD_SHARED_LIBS|OFF|build shared libraries if on, static if off (note: not working on Windows)|
|STATIC_CRT|OFF|for Windows MSVC builds only, link with /MT (or /MTd for Debug builds) if on, or with /MD (or /MDd for Debug builds) if off|
|CODA_BUILD_TESTS| ON |build tests if on|
|CODA_INSTALL_TESTS| ON |install tests if on|
|CODA_PARTIAL_INSTALL|OFF|make the install target not depend on all defined targets, only the targets which have already been built will be installed; cmake/CodaBuild.cmake for further information and caveats|
|MT_DEFAULT_PINNING|OFF|use affinity-based CPU pinning by default in MT|
|ENABLE_BOOST|OFF|build modules dependent on Boost if enabled|
|ENABLE_PYTHON|ON|build Python modules if enabled|
|ENABLE_SWIG|OFF|enable SWIG bindings generation if enabled, otherwise use previously-generated files|
|ENABLE_JARS|ON|include jars with the install|
|ENABLE_JPEG|ON|build libjpeg driver and modules depending on it|
|ENABLE_J2K|ON|build openjpeg (jpeg2000) driver and modules depending on it|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ static_assert(CODA_OSS_MAKE_VERSION_MMPB(9999, 9999, 9999, 9999) <= UINT64_MAX,

// Do this ala C++ ... we don't currently have major/minor/patch
//#define CODA_OSS_VERSION_ 20210910L // c.f. __cplusplus
#define CODA_OSS_VERSION_ 2021 ## 0011 ## 0001 ## 0000 ## L
#define CODA_OSS_VERSION_ 2021 ## 0012 ## 0013 ## 0000 ## L

// Use the same macros other projects might want to use; overkill for us.
#define CODA_OSS_VERSION_MAJOR 2021
#define CODA_OSS_VERSION_MINOR 11
#define CODA_OSS_VERSION_PATCH 1
#define CODA_OSS_VERSION_MINOR 12
#define CODA_OSS_VERSION_PATCH 13
#define CODA_OSS_VERSION_BUILD 0
#define CODA_OSS_VERSION CODA_OSS_MAKE_VERSION_MMPB(CODA_OSS_VERSION_MAJOR, CODA_OSS_VERSION_MINOR, CODA_OSS_VERSION_PATCH, CODA_OSS_VERSION_BUILD)

Expand Down
32 changes: 13 additions & 19 deletions externals/coda-oss/modules/c++/xml.lite/include/xml/lite/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define __XML_LITE_ELEMENT_H__
#pragma once

#include <assert.h>

#include <memory>
#include <string>
#include <new> // std::nothrow_t
Expand Down Expand Up @@ -479,8 +477,7 @@ class Element
const std::string& formatter) const;
};

extern void create(const std::string& name, const std::string& uri, const std::string& value, Element& parent,
Element*& result);
extern Element& create(const std::string& name, const std::string& uri, const std::string& value, Element& parent);

#ifndef SWIG
// The (old) version of SWIG we're using doesn't like certain C++11 features.
Expand Down Expand Up @@ -542,41 +539,38 @@ inline void setValue(Element& element, const T& value)
}

template <typename T, typename ToString>
inline Element& createElement(const std::string& name, const std::string& uri, const T& value, Element& parent,
inline Element& create(const std::string& name, const std::string& uri, const T& value, Element& parent,
ToString toString)
{
Element* retval;
xml::lite::create(name, uri, toString(value), parent, retval);
assert(retval != nullptr);
return *retval;
return create(name, uri, toString(value), parent);
}
template<typename T>
inline Element& createElement(const std::string& name, const std::string& uri, const T& value, Element& parent)
inline Element& create(const std::string& name, const std::string& uri, const T& value, Element& parent)
{
return createElement(name, uri, value, parent, details::toString<T>);
return create(name, uri, value, parent, details::toString<T>);
}

template <typename T, typename ToString>
inline Element& createElement(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent,
inline Element& create(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent,
ToString toString)
{
return createElement(name, uri, v.value(), parent, toString);
return create(name, uri, v.value(), parent, toString);
}
template<typename T>
inline Element& createElement(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent)
inline Element& create(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent)
{
return createElement(name, uri, v.value(), parent);
return create(name, uri, v.value(), parent);
}
template <typename T, typename ToString>
inline Element* createOptonalElement(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent,
inline Element* optionalCreate(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent,
ToString toString)
{
return v.has_value() ? &createElement(name, uri, v, parent, toString) : nullptr;
return v.has_value() ? &create(name, uri, v, parent, toString) : nullptr;
}
template<typename T>
inline Element* createOptonalElement(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent)
inline Element* optionalCreate(const std::string& name, const std::string& uri, const sys::Optional<T>& v, Element& parent)
{
return v.has_value() ? &createElement(name, uri, v, parent) : nullptr;
return v.has_value() ? &create(name, uri, v, parent) : nullptr;
}

#endif // SWIG
Expand Down
7 changes: 3 additions & 4 deletions externals/coda-oss/modules/c++/xml.lite/source/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,8 @@ void xml::lite::Element::setCharacterData(const sys::U8string& characters)
setCharacterData(str::c_str<std::string::const_pointer>(characters), StringEncoding::Utf8);
}

void xml::lite::create(const std::string& name, const std::string& uri,
const std::string& value, Element& parent, Element* &result)
xml::lite::Element& xml::lite::create(const std::string& name, const std::string& uri,
const std::string& value, Element& parent)
{
auto elem = Element::create(name, uri, value);
result = & parent.addChild(std::move(elem));
return parent.addChild(Element::create(name, uri, value));
}

0 comments on commit ef19ad2

Please sign in to comment.