- rcf.zip
- RCF
- demo
- vs2003
- RCF
- doc
- include
- RCF
- SF
- license.txt
- src
- RCF
- SF
- test
- vs2003
- RCF
- RCF.sln
- RCF
- RCF.vcproj
- RCFTest
- RCFTest.vcproj
|
//*****************************************************************************
// RCF - Remote Call Framework
// Copyright (c) 2005, Jarl Lindrud.
// Contact: jlindrud@hotmail.com .
//
// Distributed under the so-called MIT license, see accompanying file license.txt.
//*****************************************************************************
#ifndef _SF_STRING_HPP_
#define _SF_STRING_HPP_
#include <string>
#include <SF/Archive.hpp>
#include <SF/SerializeDynamicArray.hpp>
namespace SF {
// std::basic_string
template<typename C, typename T, typename A>
inline void serialize(SF::Archive &ar, std::basic_string<C,T,A> &t, const unsigned int)
{
if (ar.isRead())
{
C *pch = NULL;
UInt32 length = 0;
ar & SF::Archive::Flag( SF::Archive::NO_BEGIN_END ) & dynamicArray(pch, length);
t.assign(pch, length);
delete [] pch;
}
else if (ar.isWrite())
{
C *pch = const_cast<C *>(t.c_str());
UInt32 length = static_cast<UInt32>(t.length());
ar & SF::Archive::Flag( SF::Archive::NO_BEGIN_END ) & dynamicArray(pch, length);
}
}
} // namespace SF
#endif // ! _SF_STRING_HPP_
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Software developer, from Sweden and now living in Canberra, Australia, working on distributed C++ applications. When he is not programming, Jarl enjoys skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.