Adapt to Ghoul change (use ghoul::to_string instead of std::to_string)

This commit is contained in:
Alexander Bock
2018-07-20 13:56:15 -04:00
parent edc75c562c
commit 74fd38c260
17 changed files with 100 additions and 94 deletions

View File

@@ -27,6 +27,7 @@
#include <ghoul/misc/boolean.h>
#include <ghoul/misc/exception.h>
#include <ghoul/misc/stringconversion.h>
#include <memory>
#include <string>
#include <vector>
@@ -304,15 +305,25 @@ void testSpecificationAndThrow(const Documentation& documentation,
// Make the overload for std::to_string available for the Offense::Reason for easier
// error logging
namespace std {
namespace ghoul {
std::string to_string(openspace::documentation::TestResult testResult);
template <>
std::string to_string(const openspace::documentation::TestResult& testResult);
std::string to_string(openspace::documentation::TestResult::Offense offense);
std::string to_string(openspace::documentation::TestResult::Offense::Reason reason);
std::string to_string(openspace::documentation::TestResult::Warning warning);
std::string to_string(openspace::documentation::TestResult::Warning::Reason reason);
template <>
std::string to_string(const openspace::documentation::TestResult::Offense& offense);
} // namespace std
template <>
std::string to_string(
const openspace::documentation::TestResult::Offense::Reason& reason);
template <>
std::string to_string(const openspace::documentation::TestResult::Warning& warning);
template <>
std::string to_string(
const openspace::documentation::TestResult::Warning::Reason& reason);
} // namespace ghoul
#endif // __OPENSPACE_CORE___DOCUMENTATION___H__

View File

@@ -27,10 +27,6 @@
#include <iterator>
#include <sstream>
namespace std {
std::string to_string(std::string value);
} // namespace std
namespace openspace::documentation {
template <typename T>
@@ -140,32 +136,32 @@ TestResult OperatorVerifier<T, Operator>::operator()(const ghoul::Dictionary& di
template <typename T>
std::string LessVerifier<T>::documentation() const {
return "Less than: " + std::to_string(value);
return "Less than: " + ghoul::to_string(value);
}
template <typename T>
std::string LessEqualVerifier<T>::documentation() const {
return "Less or equal to: " + std::to_string(value);
return "Less or equal to: " + ghoul::to_string(value);
}
template <typename T>
std::string GreaterVerifier<T>::documentation() const {
return "Greater than: " + std::to_string(value);
return "Greater than: " + ghoul::to_string(value);
}
template <typename T>
std::string GreaterEqualVerifier<T>::documentation() const {
return "Greater or equal to: " + std::to_string(value);
return "Greater or equal to: " + ghoul::to_string(value);
}
template <typename T>
std::string EqualVerifier<T>::documentation() const {
return "Equal to: " + std::to_string(value);
return "Equal to: " + ghoul::to_string(value);
}
template <typename T>
std::string UnequalVerifier<T>::documentation() const {
return "Unequal to: " + std::to_string(value);
return "Unequal to: " + ghoul::to_string(value);
}
template <typename T>
@@ -290,8 +286,8 @@ TestResult InRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
template <typename T>
std::string InRangeVerifier<T>::documentation() const {
return "In range: ( " + std::to_string(lower) + "," +
std::to_string(upper) + " )";
return "In range: ( " + ghoul::to_string(lower) + "," +
ghoul::to_string(upper) + " )";
}
template <typename T>
@@ -323,8 +319,8 @@ TestResult NotInRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
template <typename T>
std::string NotInRangeVerifier<T>::documentation() const {
return "Not in range: ( " + std::to_string(lower) + "," +
std::to_string(upper) + " )";
return "Not in range: ( " + ghoul::to_string(lower) + "," +
ghoul::to_string(upper) + " )";
}

View File

@@ -29,7 +29,7 @@
#include <openspace/interaction/joystickinputstate.h>
#include <ghoul/misc/boolean.h>
#include <ghoul/misc/fromstring.h>
#include <ghoul/misc/stringconversion.h>
#include <map>
#include <vector>
@@ -103,14 +103,11 @@ private:
} // namespace openspace::interaction
namespace std {
std::string to_string(const openspace::interaction::JoystickCameraStates::AxisType& type);
} // namespace std
namespace ghoul {
template <>
std::string to_string(const openspace::interaction::JoystickCameraStates::AxisType& type);
template <>
openspace::interaction::JoystickCameraStates::AxisType
from_string(const std::string& string);

View File

@@ -25,7 +25,7 @@
#ifndef __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
#define __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
#include <ghoul/misc/fromstring.h>
#include <ghoul/misc/stringconversion.h>
#include <array>
#include <memory>
#include <string>
@@ -110,14 +110,11 @@ struct JoystickInputStates : public std::array<JoystickInputState, MaxJoysticks>
} // namespace openspace::interaction
namespace std {
std::string to_string(openspace::interaction::JoystickAction action);
} // namespace std
namespace ghoul {
template <>
std::string to_string(const openspace::interaction::JoystickAction& action);
template <>
openspace::interaction::JoystickAction from_string(const std::string& str);

View File

@@ -57,6 +57,7 @@
// All values that are defined here are compatible with (and are based on) the
// definitions GLFW v3.1
#include <ghoul/misc/stringconversion.h>
#include <map>
#include <string>
@@ -361,12 +362,17 @@ static const std::map<std::string, Key> KeyMapping = {
} // namespace openspace
namespace std {
namespace ghoul {
std::string to_string(openspace::Key key);
std::string to_string(openspace::KeyModifier mod);
std::string to_string(openspace::KeyWithModifier key);
template <>
std::string to_string(const openspace::Key& key);
} // namespace std
template <>
std::string to_string(const openspace::KeyModifier& mod);
template <>
std::string to_string(const openspace::KeyWithModifier& key);
} // namespace ghoul
#endif // __OPENSPACE_CORE___KEYS___H__