summaryrefslogtreecommitdiff
path: root/ACEXML/common/XML_Codecs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACEXML/common/XML_Codecs.cpp')
-rw-r--r--ACEXML/common/XML_Codecs.cpp97
1 files changed, 0 insertions, 97 deletions
diff --git a/ACEXML/common/XML_Codecs.cpp b/ACEXML/common/XML_Codecs.cpp
deleted file mode 100644
index 63230d8c6d7..00000000000
--- a/ACEXML/common/XML_Codecs.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-// -*- C++ -*- $Id$
-
-#include "ace/Auto_Ptr.h"
-#include "ACEXML/common/XML_Codecs.h"
-
-ACE_RCSID (common, XML_Codecs, "$Id$")
-
-ACEXML_Char*
-ACEXML_Base64::encode (const ACEXML_Char* input,
- size_t* output_len)
-{
- if (!input)
- return 0;
- size_t len = ACE_OS::strlen (input);
-
- ACE_Byte* buf = 0;
- ACE_NEW_RETURN (buf,
- ACE_Byte[len],
- 0);
- ACE_Auto_Basic_Array_Ptr<ACE_Byte> cleanup_buf (buf);
-
- for (size_t i = 0; i < len; ++i)
- buf[i] = (ACE_Byte)input[i];
- buf[len] = 0;
-
- size_t encode_len = 0;
- ACE_Byte* encodedBuf = ACE_Base64::encode (buf, len, &encode_len);
-
- if (!encodedBuf)
- return 0;
-
- ACEXML_Char* result = 0;
- ACE_NEW_RETURN (result,
- ACEXML_Char[encode_len+1],
- 0);
-
- for (size_t j = 0; j < encode_len; ++j)
- result[j] = (ACEXML_Char)encodedBuf[j];
- result[encode_len] = 0;
-
- *output_len = encode_len;
- delete[] encodedBuf;
- return result;
-}
-
-
-ACEXML_Char*
-ACEXML_Base64::decode (const ACEXML_Char* input,
- size_t* output_len)
-{
- if (!input)
- return 0;
-
- size_t len = ACE_OS::strlen (input);
-
- ACE_Byte* buf = 0;
-
- ACE_NEW_RETURN (buf,
- ACE_Byte[len],
- 0);
-
- ACE_Auto_Basic_Array_Ptr<ACE_Byte> cleanup (buf);
-
- for (size_t i = 0; i < len; ++i)
- buf[i] = (ACE_Byte)input[i];
-
- buf[len] = 0;
-
- size_t decode_len = 0;
-
- ACE_Byte* decodedBuf = ACE_Base64::decode (buf, &decode_len);
-
- if (!decodedBuf)
- return 0;
-
- ACEXML_Char* result = 0;
-
- ACE_NEW_RETURN (result,
- ACEXML_Char[decode_len+1],
- 0);
-
- for (size_t j = 0; j < decode_len; ++j)
- result[j] = (ACEXML_Char)decodedBuf[j];
-
- result[decode_len] = 0;
-
- *output_len = decode_len;
- delete[] decodedBuf;
-
- return result;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Auto_Basic_Array_Ptr<ACE_Byte>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Auto_Basic_Array_Ptr<ACE_Byte>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */