29 #include <boost/uuid/uuid_generators.hpp> 30 #include <boost/uuid/uuid_io.hpp> 31 #include <boost/functional/hash.hpp> 33 #if BOOST_VERSION >= 106700 34 #include <boost/uuid/entropy_error.hpp> 63 #if BOOST_VERSION >= 106700 70 #if BOOST_VERSION >= 106700 72 catch(
const boost::uuids::entropy_error& )
74 wxLogFatalError(
"A Boost UUID entropy exception was thrown in %s:%s.",
75 __FILE__, __FUNCTION__ );
83 wxASSERT(
null == 0 );
87 KIID::KIID(
const wxString& aString ) : m_uuid(), m_cached_timestamp( 0 )
89 if( aString.length() == 8 )
94 for(
int i = 0; i < 4; ++i )
96 wxString octet = aString.substr( i * 2, 2 );
97 m_uuid.data[i + 12] = strtol( octet.data(),
NULL, 16 );
115 #if BOOST_VERSION >= 106700 122 #if BOOST_VERSION >= 106700 124 catch(
const boost::uuids::entropy_error& )
126 wxLogFatalError(
"A Boost UUID entropy exception was thrown in %s:%s.",
127 __FILE__, __FUNCTION__ );
139 if( aCandidate.Length() != niluuidStr.Length() )
142 for( wxChar c : aCandidate )
144 if( c >=
'0' && c <=
'9' )
147 if( c >=
'a' && c <=
'f' )
150 if( c >=
'A' && c <=
'F' )
172 for(
int i = 0; i < 4; ++i )
174 wxString octet = str.substr( i * 2, 2 );
175 m_uuid.data[i + 12] = strtol( octet.data(),
NULL, 16 );
199 for(
int i = 0; i < 4; ++i )
215 return boost::uuids::to_string(
m_uuid );
237 for(
const wxString& pathStep : wxSplit( aString,
'/' ) )
239 if( !pathStep.empty() )
240 emplace_back(
KIID( pathStep ) );
249 for(
const KIID& pathStep : *
this )
wxString AsString() const
boost::uuids::uuid m_uuid
static void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
bool IsLegacyTimestamp() const
timestamp_t m_cached_timestamp
static boost::uuids::nil_generator nilGenerator
timestamp_t AsLegacyTimestamp() const
static bool SniffTest(const wxString &aCandidate)
static boost::uuids::random_generator randomGenerator
void ConvertTimestampToUuid()
Change an existing time stamp based UUID into a true UUID.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
uint32_t timestamp_t
timestamp_t is our type to represent unique IDs for all kinds of elements; historically simply the ti...
void Clone(const KIID &aUUID)
wxString AsLegacyTimestampString() const
wxString AsString() const
static boost::uuids::string_generator stringGenerator