11#ifndef __BE_MEMORY_AUTOARRAYUTILITY_H__
12#define __BE_MEMORY_AUTOARRAYUTILITY_H__
27 namespace AutoArrayUtility
39 template <
typename T,
typename =
typename
40 std::enable_if<std::is_same<T, uint8_t>::value ||
41 std::is_same<T, char>::value>::type>
46 return ((
char *)&(*rahc));
64 template <
typename T,
typename =
typename
65 std::enable_if<std::is_same<T, uint8_t>::value ||
66 std::is_same<T, char>::value>::type>
72 if (count > aa.
size())
75 return (std::string(
cstr(aa), count));
87 template <
typename T,
typename =
typename
88 std::enable_if<std::is_same<T, uint8_t>::value ||
89 std::is_same<T, char>::value>::type>
93 const std::string &str)
96 ::snprintf(
cstr(aa), aa.
size(),
"%s",
111 template <
typename T,
typename =
typename
112 std::enable_if<std::is_same<T, uint8_t>::value ||
113 std::is_same<T, char>::value>::type>
120 aa.
resize(strlen(str) + 1);
124 ::vsnprintf(
cstr(aa), aa.
size(), str, args);
141template <
typename T,
typename =
typename
142 std::enable_if<std::is_same<T, uint8_t>::value ||
143 std::is_same<T, char>::value>::type>
std::string to_string(const BiometricEvaluation::Memory::AutoArray< T > &aa)
Convert a uint8_t or char AutoArray to a string.
An error occurred when allocating an object.
A C-style array wrapped in the facade of a C++ STL container.
size_type size() const
Obtain the number of accessible elements.
size_t size_type
Type of subscripts, counts, etc.
void resize(size_type new_size, bool free=false)
Change the number of accessible elements.
std::string getString(const AutoArray< T > &aa, typename AutoArray< T >::size_type count)
Convert a uint8_t or char AutoArray to a string.
char * cstr(const AutoArray< T > &rahc)
Cast an AutoArray of uint8_t or char to a char*.
void setString(AutoArray< T > &aa, const std::string &str)
Copy a string into an AutoAray of uint8_t or char.
This software was developed at the National Institute of Standards and Technology (NIST) by employees...