2 * \file storage_value.cpp
4 * \date 2012-08-18 15:00GMT
5 * \author Jan Boon (Kaetemi)
10 * Copyright (C) 2012 by authors
12 * This file is part of RYZOM CORE PIPELINE.
13 * RYZOM CORE PIPELINE is free software: you can redistribute it
14 * and/or modify it under the terms of the GNU Affero General Public
15 * License as published by the Free Software Foundation, either
16 * version 3 of the License, or (at your option) any later version.
18 * RYZOM CORE PIPELINE is distributed in the hope that it will be
19 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Affero General Public License for more details.
23 * You should have received a copy of the GNU Affero General Public
24 * License along with RYZOM CORE PIPELINE. If not, see
25 * <http://www.gnu.org/licenses/>.
28 #include <nel/misc/types_nl.h>
29 #include "storage_value.h"
34 // #include <nel/misc/debug.h>
39 // using namespace NLMISC;
45 void CStorageValue
<std::string
>::serial(NLMISC::IStream
&stream
)
47 stream
.serialBuffer(static_cast<uint8
*>(static_cast<void *>(&Value
[0])), Value
.size());
51 void CStorageValue
<ucstring
>::serial(NLMISC::IStream
&stream
)
53 stream
.serialBuffer(static_cast<uint8
*>(static_cast<void *>(&Value
[0])), Value
.size() * 2);
57 void CStorageValue
<ucstring
>::toString(std::ostream
&ostream
, const std::string
&pad
) const
59 ostream
<< "(" << className() << ") { " << Value
.toUtf8() << " } ";
63 void CStorageValue
<std::string
>::setSize(sint32 size
)
69 void CStorageValue
<ucstring
>::setSize(sint32 size
)
71 Value
.resize(size
/ 2);
75 bool CStorageValue
<std::string
>::getSize(sint32
&size
) const
81 bool CStorageValue
<ucstring
>::getSize(sint32
&size
) const
83 return Value
.size() * 2;
87 } /* namespace PIPELINE */