Skip to content

Commit

Permalink
A few nothrow qualifiers added to shared_str helpers. Comments added …
Browse files Browse the repository at this point in the history
…about future fixes (tagged with "tamlin:")
  • Loading branch information
tamlin-mike authored and Xottab-DUTY committed Aug 5, 2017
1 parent 8399442 commit 7f6d671
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/xrCore/xrstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#define xrstringH
#pragma once

// TODO: tamlin: Get rid of _std_extensions.h as compile-time dependency, if possible.
#include "_std_extensions.h"

#pragma pack(push, 4)
//////////////////////////////////////////////////////////////////////////
// TODO: tamlin: Get rid of this blobal namespace polluting silly typedef.
typedef const char* str_c;

//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -168,10 +170,10 @@ IC bool operator<(shared_str const& a, shared_str const& b) { return a._get() <
IC bool operator>(shared_str const& a, shared_str const& b) { return a._get() > b._get(); }
// externally visible standart functionality
IC void swap(shared_str& lhs, shared_str& rhs) { lhs.swap(rhs); }
IC u32 xr_strlen(shared_str& a) { return a.size(); }
IC int xr_strcmp(const shared_str& a, const char* b) { return xr_strcmp(*a, b); }
IC int xr_strcmp(const char* a, const shared_str& b) { return xr_strcmp(a, *b); }
IC int xr_strcmp(const shared_str& a, const shared_str& b)
IC u32 xr_strlen(const shared_str& a) throw() { return a.size(); }
IC int xr_strcmp(const shared_str& a, const char* b) throw() { return xr_strcmp(*a, b); }
IC int xr_strcmp(const char* a, const shared_str& b) throw() { return xr_strcmp(a, *b); }
IC int xr_strcmp(const shared_str& a, const shared_str& b) throw()
{
if (a.equal(b))
return 0;
Expand All @@ -194,6 +196,8 @@ IC void xr_strlwr(shared_str& src)
}
}

#pragma todo("tamlin: Move xr_strlwr into a static lib (f.ex. 'xrMisc_lib')")

#pragma pack(pop)

#endif

0 comments on commit 7f6d671

Please sign in to comment.