Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / 3d / pipeline_max / storage_value.cpp
blob3927be681932bb19b444b7036eb801bbcf54f5a1
1 /**
2 * \file storage_value.cpp
3 * \brief CStorageValue
4 * \date 2012-08-18 15:00GMT
5 * \author Jan Boon (Kaetemi)
6 * CStorageValue
7 */
9 /*
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"
31 // STL includes
33 // NeL includes
34 // #include <nel/misc/debug.h>
36 // Project includes
38 using namespace std;
39 // using namespace NLMISC;
41 namespace PIPELINE {
42 namespace MAX {
44 template <>
45 void CStorageValue<std::string>::serial(NLMISC::IStream &stream)
47 stream.serialBuffer(static_cast<uint8 *>(static_cast<void *>(&Value[0])), Value.size());
50 template <>
51 void CStorageValue<ucstring>::serial(NLMISC::IStream &stream)
53 stream.serialBuffer(static_cast<uint8 *>(static_cast<void *>(&Value[0])), Value.size() * 2);
56 template <>
57 void CStorageValue<ucstring>::toString(std::ostream &ostream, const std::string &pad) const
59 ostream << "(" << className() << ") { " << Value.toUtf8() << " } ";
62 template <>
63 void CStorageValue<std::string>::setSize(sint32 size)
65 Value.resize(size);
68 template <>
69 void CStorageValue<ucstring>::setSize(sint32 size)
71 Value.resize(size / 2);
74 template <>
75 bool CStorageValue<std::string>::getSize(sint32 &size) const
77 return Value.size();
80 template <>
81 bool CStorageValue<ucstring>::getSize(sint32 &size) const
83 return Value.size() * 2;
86 } /* namespace MAX */
87 } /* namespace PIPELINE */
89 /* end of file */