2 * Copyright 2001-2009 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file shibsp/attribute/BinaryAttribute.h
20 * An Attribute whose values are binary data.
23 #ifndef __shibsp_binattr_h__
24 #define __shibsp_binattr_h__
26 #include <shibsp/attribute/Attribute.h>
30 #if defined (_MSC_VER)
31 #pragma warning( push )
32 #pragma warning( disable : 4251 )
36 * An Attribute whose values are binary data.
38 * <p>Binary attributes use base64 encoding to serialize their values.
39 * The original binary values are accessible in the underlying value
42 class SHIBSP_API BinaryAttribute : public Attribute
48 * @param ids array with primary identifier in first position, followed by any aliases
50 BinaryAttribute(const std::vector<std::string>& ids);
53 * Constructs based on a remoted BinaryAttribute.
55 * @param in input object containing marshalled BinaryAttribute
57 BinaryAttribute(DDF& in);
59 virtual ~BinaryAttribute();
62 * Returns the set of raw binary values.
64 * @return a mutable vector of the values
66 std::vector<std::string>& getValues();
69 * Returns the set of raw binary values.
71 * @return an immutable vector of the values
73 const std::vector<std::string>& getValues() const;
75 // Virtual function overrides.
76 size_t valueCount() const;
77 void clearSerializedValues();
78 const char* getString(size_t index) const;
79 void removeValue(size_t index);
80 const std::vector<std::string>& getSerializedValues() const;
84 std::vector<std::string> m_values;
87 #if defined (_MSC_VER)
88 #pragma warning( pop )
93 #endif /* __shibsp_scopedattr_h__ */