Safir SDK Core
Loading...
Searching...
No Matches
Utilities.h
Go to the documentation of this file.
1/******************************************************************************
2*
3* Copyright Saab AB, 2006-2013 (http://safirsdkcore.com)
4*
5* Created by: Lars Hagström / stlrha
6*
7*******************************************************************************
8*
9* This file is part of Safir SDK Core.
10*
11* Safir SDK Core is free software: you can redistribute it and/or modify
12* it under the terms of version 3 of the GNU General Public License as
13* published by the Free Software Foundation.
14*
15* Safir SDK Core is distributed in the hope that it will be useful,
16* but WITHOUT ANY WARRANTY; without even the implied warranty of
17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18* GNU General Public License for more details.
19*
20* You should have received a copy of the GNU General Public License
21* along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22*
23******************************************************************************/
24
25#ifndef __DOTS_UTILITIES_H__
26#define __DOTS_UTILITIES_H__
27
29#include <string>
30#include <memory>
31
32namespace Safir
33{
34namespace Dob
35{
36namespace Typesystem
37{
38 //Forward declaration to avoid a bunch of includes.
39 class Object;
40
42 typedef std::shared_ptr<Object> ObjectPtr;
43
45 typedef std::shared_ptr<const Object> ObjectConstPtr;
46
50namespace Utilities
51{
58 DOTS_CPP_API const std::string ToUtf8(const std::wstring & wstr);
59
66 DOTS_CPP_API const std::wstring ToWstring(const std::string & str);
67
79
89 DOTS_CPP_API const std::string BinaryToBase64(char const * const binarySource, int sourceSize);
90
99 DOTS_CPP_API const std::string BinaryToBase64(const Dob::Typesystem::Binary & bin);
100
109 DOTS_CPP_API void Base64ToBinary(const std::string& base64Str, Dob::Typesystem::Binary & binary);
110}
111}
112}
113}
114
115
116#endif
117
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
std::shared_ptr< const Object > ObjectConstPtr
A smart pointer to a const Object.
Definition Object.h:47
std::vector< char > Binary
A type to contain binary data.
Definition Defs.h:306
std::shared_ptr< Object > ObjectPtr
A smart pointer to an Object.
Definition Object.h:44
DOTS_CPP_API const std::string BinaryToBase64(char const *const binarySource, int sourceSize)
Converts binary data to Base64.
DOTS_CPP_API void Base64ToBinary(const std::string &base64Str, Dob::Typesystem::Binary &binary)
Converts data in Base64 format into binary data format.
DOTS_CPP_API const std::string ToUtf8(const std::wstring &wstr)
Convert a std::wstring to UTF8-encoded std::string.
DOTS_CPP_API const std::wstring ToWstring(const std::string &str)
Convert a UTF8-encoded std::string to std::wstring.
DOTS_CPP_API void MergeChanges(ObjectPtr into, const ObjectConstPtr &from)
Merge the changed members (recursively) from one object into another.
#define DOTS_CPP_API
Definition Defs.h:33