1145247Sdamien///////////////////////////////////////////////////////////////////////////
2145247Sdamien//
3145247Sdamien// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
4145247Sdamien// Digital Ltd. LLC
5145247Sdamien//
6145247Sdamien// All rights reserved.
7145247Sdamien//
8145247Sdamien// Redistribution and use in source and binary forms, with or without
9145247Sdamien// modification, are permitted provided that the following conditions are
10145247Sdamien// met:
11145247Sdamien// *       Redistributions of source code must retain the above copyright
12145247Sdamien// notice, this list of conditions and the following disclaimer.
13145247Sdamien// *       Redistributions in binary form must reproduce the above
14145247Sdamien// copyright notice, this list of conditions and the following disclaimer
15145247Sdamien// in the documentation and/or other materials provided with the
16145247Sdamien// distribution.
17145247Sdamien// *       Neither the name of Industrial Light & Magic nor the names of
18145247Sdamien// its contributors may be used to endorse or promote products derived
19145247Sdamien// from this software without specific prior written permission.
20145247Sdamien//
21145247Sdamien// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22145247Sdamien// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23145247Sdamien// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24145247Sdamien// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25145247Sdamien// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26145247Sdamien// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27145247Sdamien// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28145247Sdamien// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29145247Sdamien// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30145247Sdamien// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31145247Sdamien// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32145247Sdamien//
33145247Sdamien///////////////////////////////////////////////////////////////////////////
34145247Sdamien
35145247Sdamien
36145247Sdamien
37145247Sdamien//-----------------------------------------------------------------------------
38145247Sdamien//
39145247Sdamien//	class StringAttribute
40145247Sdamien//
41145247Sdamien//-----------------------------------------------------------------------------
42145247Sdamien
43145247Sdamien#include <ImfStringAttribute.h>
44145247Sdamien
45145247Sdamien
46145247Sdamiennamespace Imf {
47145247Sdamien
48145247Sdamien
49152611Sdamientemplate <>
50152611Sdamienconst char *
51152611SdamienStringAttribute::staticTypeName ()
52152611Sdamien{
53145247Sdamien    return "string";
54145247Sdamien}
55145247Sdamien
56145247Sdamien
57145247Sdamientemplate <>
58145247Sdamienvoid
59145247SdamienStringAttribute::writeValueTo (OStream &os, int version) const
60145247Sdamien{
61145247Sdamien    int size = _value.size();
62145247Sdamien
63145247Sdamien    for (int i = 0; i < size; i++)
64145247Sdamien	Xdr::write <StreamIO> (os, _value[i]);
65145247Sdamien}
66145247Sdamien
67145247Sdamien
68145247Sdamientemplate <>
69145247Sdamienvoid
70145247SdamienStringAttribute::readValueFrom (IStream &is, int size, int version)
71145247Sdamien{
72145247Sdamien    _value.resize (size);
73145247Sdamien
74145247Sdamien    for (int i = 0; i < size; i++)
75145247Sdamien	Xdr::read <StreamIO> (is, _value[i]);
76145247Sdamien}
77145247Sdamien
78145247Sdamien
79145247Sdamien} // namespace Imf
80145247Sdamien