Remove Activ libs and includes
This commit is contained in:
1 parent
28ed30c944
commit
4b718994be
10967 files changed
-2306716
No files matched your search
@@ -1,238 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Misc/StringView.h
|
||||
*
|
||||
* @brief string_view helpers.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_MISC_STRING_VIEW_H)
|
||||
#define ACTIV_MISC_STRING_VIEW_H
|
||||
|
||||
#include "ActivMiddleware/ActivMiddleware.h"
|
||||
#include "ActivMiddleware/CxxYZ/string_view.h"
|
||||
#include "ActivMiddleware/CxxYZ/type_traits.h"
|
||||
|
||||
#include ACTIV_BOOST_INCLUDE(functional/hash.hpp)
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace ACTIV_CXXYZ_STRING_VIEW_NAMESPACE
|
||||
{
|
||||
|
||||
inline std::size_t hash_value(string_view str)
|
||||
{
|
||||
// Sadly ADL won't work with types using-ed into another namespace, so we have to define this in the underlying
|
||||
// string_view namespace.
|
||||
return Boost::hash_range(str.begin(), str.end());
|
||||
}
|
||||
|
||||
} // namespace ACTIV_CXXYZ_STRING_VIEW_NAMESPACE
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#if (!defined ACTIV_BOOST_NO_CXX11_HDR_FUNCTIONAL) && (!defined ACTIV_CXXYZ_USING_STD_STRING_VIEW)
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
template<>
|
||||
struct hash<Activ::CxxYZ::string_view>
|
||||
{
|
||||
size_t operator()(Activ::CxxYZ::string_view str) const
|
||||
{
|
||||
return hash_value(str);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif // (!defined ACTIV_BOOST_NO_CXX11_HDR_FUNCTIONAL) && (!defined ACTIV_CXXYZ_USING_STD_STRING_VIEW)
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
//! Activ namespace.
|
||||
namespace Activ
|
||||
{
|
||||
|
||||
namespace Detail
|
||||
{
|
||||
|
||||
template<typename TARGET>
|
||||
class ToStringTypeImpl
|
||||
{
|
||||
public:
|
||||
template<typename SOURCE>
|
||||
TARGET operator()(const SOURCE &string) const ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return TARGET(string.data(), string.length());
|
||||
}
|
||||
|
||||
TARGET operator()(const char *string) const ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return TARGET(string, ::strlen(string));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Detail
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Convert a string-like type to another string-like type. string_view doesn't support vstring,
|
||||
* so this allows generic code to work with std::string, String, etc.
|
||||
*
|
||||
* @tparam TARGET a string-like type (constructed from a const char * and a length).
|
||||
* @tparam SOURCE a string-like type (with data() and length() methods).
|
||||
*
|
||||
* @param string reference to a string-like object.
|
||||
*
|
||||
* @return A new TARGET containing or referring to @a string.
|
||||
*/
|
||||
template<typename TARGET, typename SOURCE>
|
||||
inline TARGET ToStringType(const SOURCE &string) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
// Extra level of indirection to allow partial specialization, should we ever need it.
|
||||
return Activ::Detail::ToStringTypeImpl<TARGET>()(string);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Functor that can compare any combination of string_view or String. For use in, for example,
|
||||
* a multi_index to allow compatible key lookups. N3421 will probably obviate the need for this one day.
|
||||
*
|
||||
* @tparam COMPARE the comparison predicate to use (std::equal_to, std::less, etc.).
|
||||
*/
|
||||
template<template<typename> class COMPARE>
|
||||
class StringComparisonFunctor
|
||||
{
|
||||
public:
|
||||
template<typename T1, typename T2>
|
||||
bool operator()(const T1 &lhs, const T2 &rhs) const
|
||||
{
|
||||
ACTIV_BOOST_STATIC_ASSERT(CxxYZ::is_same<typename T1::value_type, typename T2::value_type>::value);
|
||||
|
||||
return COMPARE<CxxYZ::string_view>()(ToStringType<CxxYZ::string_view>(lhs), ToStringType<CxxYZ::string_view>(rhs));
|
||||
}
|
||||
|
||||
typedef void is_transparent;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Functor that can hash a string_view or String. For use in, for example, a multi_index hashed_(non_)unique
|
||||
* index to allow compatible key lookups.
|
||||
*/
|
||||
class StringHashFunctor
|
||||
{
|
||||
public:
|
||||
template<typename T>
|
||||
size_t operator()(const T &string) const
|
||||
{
|
||||
return Boost::hash<T>()(string);
|
||||
}
|
||||
|
||||
typedef void is_transparent;
|
||||
};
|
||||
|
||||
} // namespace Activ
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#if (defined ACTIV_USING_ALTERNATIVE_STRING)
|
||||
|
||||
namespace ACTIV_CXXYZ_STRING_VIEW_NAMESPACE
|
||||
{
|
||||
|
||||
// Boost pass string_view by value, so we'll do the same.
|
||||
|
||||
inline bool operator==(string_view lhs, const Activ::String &rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs == Activ::ToStringType<string_view>(rhs);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator==(const Activ::String &lhs, string_view rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return Activ::ToStringType<string_view>(lhs) == rhs;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator!=(string_view lhs, const Activ::String &rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs != Activ::ToStringType<string_view>(rhs);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator!=(const Activ::String &lhs, string_view rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return Activ::ToStringType<string_view>(lhs) != rhs;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator<(string_view lhs, const Activ::String &rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs < Activ::ToStringType<string_view>(rhs);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator<(const Activ::String &lhs, string_view rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return Activ::ToStringType<string_view>(lhs) < rhs;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator>(string_view lhs, const Activ::String &rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs > Activ::ToStringType<string_view>(rhs);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator>(const Activ::String &lhs, string_view rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return Activ::ToStringType<string_view>(lhs) > rhs;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator<=(string_view lhs, const Activ::String &rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs <= Activ::ToStringType<string_view>(rhs);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator<=(const Activ::String &lhs, string_view rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return Activ::ToStringType<string_view>(lhs) <= rhs;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator>=(string_view lhs, const Activ::String &rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs >= Activ::ToStringType<string_view>(rhs);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
inline bool operator>=(const Activ::String &lhs, string_view rhs) ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return Activ::ToStringType<string_view>(lhs) >= rhs;
|
||||
}
|
||||
|
||||
} // namespace ACTIV_CXXYZ_STRING_VIEW_NAMESPACE
|
||||
|
||||
#endif // (defined ACTIV_USING_ALTERNATIVE_STRING)
|
||||
|
||||
#endif // (!defined ACTIV_MISC_STRING_VIEW_H)
|
||||
Reference in new issue
Block a user