Skip to content

Commit

Permalink
Refactor a bit xr_token
Browse files Browse the repository at this point in the history
Replace typedef by type alias for xr_string
  • Loading branch information
Xottab-DUTY committed Nov 13, 2017
1 parent e05649a commit 2039fc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/xrCommon/xr_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "xalloc.h"

// string(char)
typedef std::basic_string<char, std::char_traits<char>, xalloc<char>> xr_string;
using xr_string = std::basic_string<char, std::char_traits<char>, xalloc<char>>;

inline void xr_strlwr(xr_string& src)
{
Expand Down
11 changes: 7 additions & 4 deletions src/xrCore/xrCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,20 @@
// stl ext
struct XRCORE_API xr_rtoken
{
shared_str name;
xr_string name;
int id;

xr_rtoken(pcstr _nm, int _id)
xr_rtoken(const pcstr _nm, const int _id)
{
name = _nm;
id = _id;
}

void rename(pcstr _nm) { name = _nm; }
bool equal(pcstr _nm) const { return (0 == xr_strcmp(*name, _nm)); }
void rename(const pcstr _nm) { name = _nm; }
bool equal(const pcstr _nm) const
{
return name.compare(_nm) == 0;
}
};

#pragma pack(push, 1)
Expand Down

0 comments on commit 2039fc6

Please sign in to comment.