projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e712624
)
Add a variant of hex_encode
author
Perttu Ahola
<celeron55@gmail.com>
Sun, 25 Mar 2012 11:03:22 +0000
(14:03 +0300)
committer
Perttu Ahola
<celeron55@gmail.com>
Sun, 25 Mar 2012 11:48:19 +0000
(14:48 +0300)
src/hex.h
patch
|
blob
|
history
diff --git
a/src/hex.h
b/src/hex.h
index 1afb8759716f2a373d8fe61af10c5ee785a45b96..84b2656286745679a2bddda8de6b94c787c6ce44 100644
(file)
--- a/
src/hex.h
+++ b/
src/hex.h
@@
-24,7
+24,7
@@
with this program; if not, write to the Free Software Foundation, Inc.,
static const char hex_chars[] = "0123456789abcdef";
-static std::string hex_encode(const char *data, unsigned int data_size)
+static
inline
std::string hex_encode(const char *data, unsigned int data_size)
{
std::string ret;
char buf2[3];
@@
-41,4
+41,9
@@
static std::string hex_encode(const char *data, unsigned int data_size)
return ret;
}
+static inline std::string hex_encode(const std::string &data)
+{
+ return hex_encode(data.c_str(), data.size());
+}
+
#endif