summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-02-25 10:16:26 +0000
committerMarc Laukien <marc@zeroc.com>2002-02-25 10:16:26 +0000
commit2c9f99274a48edc4ef171e532af6b02378835f06 (patch)
treefd06912f9b8127595cb967fa0b6e63a686b05e4e /cpp
parentcleanup; workarounds for Win32 problems (diff)
downloadice-2c9f99274a48edc4ef171e532af6b02378835f06.tar.bz2
ice-2c9f99274a48edc4ef171e532af6b02378835f06.tar.xz
ice-2c9f99274a48edc4ef171e532af6b02378835f06.zip
fix
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/IceUtil/Base64.h13
-rw-r--r--cpp/include/IceUtil/IceUtil.h5
-rw-r--r--cpp/src/IceUtil/Base64.cpp12
3 files changed, 17 insertions, 13 deletions
diff --git a/cpp/include/IceUtil/Base64.h b/cpp/include/IceUtil/Base64.h
index 2acf46a1f87..d7c69321750 100644
--- a/cpp/include/IceUtil/Base64.h
+++ b/cpp/include/IceUtil/Base64.h
@@ -8,19 +8,19 @@
//
// **********************************************************************
-#ifndef ICE_UTIL_BASE64_H
-#define ICE_UTIL_BASE64_H
+#ifndef ICE_UTIL_BASE_64_H
+#define ICE_UTIL_BASE_64_H
#include <IceUtil/Config.h>
#include <string>
#include <vector>
-using std::vector;
-using std::string;
-
namespace IceUtil
{
+using std::vector;
+using std::string;
+
// Defined here to avoid using Ice::ByteSeq
typedef vector<char> ICE_UTIL_API ByteSeq;
@@ -31,12 +31,11 @@ public:
static string encode(const ByteSeq&);
static ByteSeq decode(const string&);
-
private:
+
static char encode(unsigned char);
static unsigned char decode(char);
static bool isBase64(char);
-
};
}
diff --git a/cpp/include/IceUtil/IceUtil.h b/cpp/include/IceUtil/IceUtil.h
index ac46c2a55a3..b080cc3b8ff 100644
--- a/cpp/include/IceUtil/IceUtil.h
+++ b/cpp/include/IceUtil/IceUtil.h
@@ -11,6 +11,10 @@
#ifndef ICE_UTIL_ICE_UTIL_H
#define ICE_UTIL_ICE_UTIL_H
+//
+// This file must include *all* other headers of IceUtil.
+//
+
#include <IceUtil/Functional.h>
#include <IceUtil/Shared.h>
#include <IceUtil/Unicode.h>
@@ -20,5 +24,6 @@
#include <IceUtil/RWRecMutex.h>
#include <IceUtil/Monitor.h>
#include <IceUtil/Thread.h>
+#include <IceUtil/Base64.h>
#endif
diff --git a/cpp/src/IceUtil/Base64.cpp b/cpp/src/IceUtil/Base64.cpp
index 7f65da07865..be9622528e1 100644
--- a/cpp/src/IceUtil/Base64.cpp
+++ b/cpp/src/IceUtil/Base64.cpp
@@ -98,15 +98,15 @@ IceUtil::Base64::encode(const ByteSeq& plainSeq)
}
IceUtil::ByteSeq
-IceUtil::Base64::decode(const string& _str)
+IceUtil::Base64::decode(const string& s)
{
string str;
- for (unsigned int j = 0; j < _str.length(); j++)
+ for (unsigned int j = 0; j < s.length(); j++)
{
- if (isBase64(_str[j]))
+ if (isBase64(s[j]))
{
- str += _str[j];
+ str += s[j];
}
}
@@ -118,8 +118,8 @@ IceUtil::Base64::decode(const string& _str)
}
// Figure out how long the final sequence is going to be.
- long lines = _str.size() / 78;
- long totalBytes = (lines * 76) + (((_str.size() - (lines * 78)) * 3) / 4);
+ long lines = s.size() / 78;
+ long totalBytes = (lines * 76) + (((s.size() - (lines * 78)) * 3) / 4);
retval.reserve(totalBytes);