[Zrouter-src] ZRouter.org: push to zconf++ zconf++/utils.cc zconf++/utils.h

zrouter-src at zrouter.org zrouter-src at zrouter.org
Mon Jan 9 00:34:35 UTC 2012


details:   /rev/91deb01230f9
changeset: 30:91deb01230f9
user:      "Nicolai Petri <nicolai at petri.dk>"
date:      Mon Jan 09 01:31:40 2012 +0100
description:
Add chars_to_string that can handle unsigned chars.

diffstat:

 zconf++/utils.cc |  9 +++++++++
 zconf++/utils.h  |  1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r e823a99c2d86 -r 91deb01230f9 zconf++/utils.cc
--- a/zconf++/utils.cc	Mon Jan 09 01:31:04 2012 +0100
+++ b/zconf++/utils.cc	Mon Jan 09 01:31:40 2012 +0100
@@ -44,4 +44,13 @@
 	return ret;
 }
 
+string chars_to_string(deque<unsigned char>::const_iterator is, deque<unsigned char>::const_iterator ie) {
+	string ret;
+	while (is != ie) {
+		ret += *is;
+		is++;
+	}
+	return ret;
 }
+
+}
diff -r e823a99c2d86 -r 91deb01230f9 zconf++/utils.h
--- a/zconf++/utils.h	Mon Jan 09 01:31:04 2012 +0100
+++ b/zconf++/utils.h	Mon Jan 09 01:31:40 2012 +0100
@@ -32,6 +32,7 @@
 namespace ZRouter {
 
 std::string chars_to_string(std::deque<char>::const_iterator is, std::deque<char>::const_iterator ie);
+std::string chars_to_string(std::deque<unsigned char>::const_iterator is, std::deque<unsigned char>::const_iterator ie);
 
 void dump_string_array(std::string s);
 


More information about the Zrouter-src mailing list