Merge pull request #2220 from DOCGroup/revert-2217-jwi-inetwraning
[ACE_TAO.git] / ACE / ACEXML / common / XML_Codecs.h
blobb20076aa28e48507c9e1dc337cf08bd3f4696323
1 // -*- C++ -*-
3 /**
4 * @file XML_Codecs.h
6 * @author Krishnakumar B <kitty@cs.wustl.edu>
8 * XML_Codecs is a generic wrapper for various encoding and decoding
9 * mechanisms used in ACEXML. Currently it includes support for handling
10 * Base64 content transfer-encoding of ACEXML_Chars.
13 #ifndef _ACEXML_XML_CODECS_H
14 #define _ACEXML_XML_CODECS_H
16 #include /**/ "ace/pre.h"
17 #include "ACEXML/common/ACEXML_Export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ACEXML/common/XML_Types.h"
24 #include "ace/Codecs.h"
26 /**
27 * @class ACEXML_Base64
29 * @brief Encode/Decode a stream of ACEXML_Chars according to Base64 encoding.
31 * This class provides methods to encode or decode a stream of ACEXML_Chars
32 * to/from Base64 encoding. It doesn't convert the input stream to a
33 * canonical form before encoding.
35 class ACEXML_Export ACEXML_Base64 : public ACE_Base64
37 public:
38 //@{
39 /**
40 * Encodes a stream of octets to Base64 data
42 * @param input Binary data in ACEXML_Char stream.
43 * @param output_len Length of the encoded Base64 ACEXML_Char stream.
44 * @return Encoded Base64 data in ACEXML_Char stream or NULL if input data
45 * cannot be encoded.
48 static ACEXML_Char* encode (const ACEXML_Char* input,
49 size_t* output_len);
50 /**
51 * Decodes a stream of Base64 to octets data
53 * @param input Encoded Base64 data in ACEXML_Char stream.
54 * @param output_len Length of the binary ACEXML_Char stream.
55 * @return Binary data in ACEXML_Char stream or NULL if input data cannot
56 * be encoded.
58 static ACEXML_Char* decode (const ACEXML_Char* input,
59 size_t* output_len);
61 //@}
65 #include /**/ "ace/post.h"
67 #endif /* _ACEXML_XML_CODECS_H */