~vcs-imports/wengophone/trunk

« back to all changes in this revision

Viewing changes to libs/util/util/include/util/Base64.h

  • Committer: tanguy_k
  • Date: 2006-11-15 14:12:35 UTC
  • Revision ID: vcs-imports@canonical.com-20061115141235-6efc6e38eaa40ca0
* (compilation fix) OWBuild: rename portaudio to PORTAUDIO
* Libutil has only one include path now -> faster compilation
* Remove old directories
* (compilation fix) phapi: ph_msession_stopped() was a macro inside phmedia.h, now it is a standard function. Don't know why but it was not compiling under Windows using CMake

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * WengoPhone, a voice over Internet phone
3
 
 * Copyright (C) 2004-2006  Wengo
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 */
19
 
 
20
 
#ifndef OWBASE64_H
21
 
#define OWBASE64_H
22
 
 
23
 
#include <util/owutildll.h>
24
 
#include <util/NonCopyable.h>
25
 
 
26
 
#include <string>
27
 
 
28
 
/**
29
 
 * Base64 encoding and decoding.
30
 
 *
31
 
 * Base64 is commonly used in everyday SMTP mail messages, for example.
32
 
 * Note that encoding is not compression: it simply reduces a byte stream
33
 
 * to printable ASCII characters, actually increasing the size of the data
34
 
 * as a side effect (e.g. where the original data is a 100-byte stream
35
 
 * containing values 0-255, the base64 encoding will be a 136-byte stream
36
 
 * containing values 0-63, the effect being that these can be ASCII-encoded).
37
 
 *
38
 
 * @see http://www.ietf.org/rfc/rfc3548.txt
39
 
 * @author Tanguy Krotoff
40
 
 */
41
 
class Base64 : NonCopyable {
42
 
public:
43
 
 
44
 
        /**
45
 
         * Encodes using base64.
46
 
         *
47
 
         * @param stringToEncode string to encode
48
 
         * @return encoded string
49
 
         */
50
 
        OWUTIL_API static std::string encode(const std::string & stringToEncode);
51
 
 
52
 
        /**
53
 
         * Decodes using base64.
54
 
         *
55
 
         * @param encodedString encoded string
56
 
         * @return decoded string
57
 
         */
58
 
        OWUTIL_API static std::string decode(const std::string & encodedString);
59
 
};
60
 
 
61
 
#endif  //OWBASE64_H