Initial string reduction code

This commit is contained in:
John Wellbelove 2020-10-26 19:32:48 +00:00
parent cc05b1df52
commit 25e353538a
23 changed files with 3581 additions and 612 deletions

View File

@ -50,6 +50,7 @@ SOFTWARE.
#include "integral_limits.h"
#include "exception.h"
#include "memory.h"
#include "exception.h"
#undef ETL_FILE
#define ETL_FILE "27"
@ -149,10 +150,7 @@ namespace etl
typedef size_t size_type;
enum
{
npos = etl::integral_limits<size_t>::max
};
static const size_type npos = etl::integral_limits<size_type>::max;
//*************************************************************************
/// Gets the current size of the string.
@ -212,16 +210,17 @@ namespace etl
/// Returns the remaining capacity.
///\return The remaining capacity.
//*************************************************************************
size_t available() const
size_type available() const
{
return max_size() - size();
}
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
//*************************************************************************
/// Returns whether the string was truncated by the last operation.
///\return Whether the string was truncated by the last operation.
//*************************************************************************
size_t truncated() const
bool truncated() const
{
return is_truncated;
}
@ -233,7 +232,9 @@ namespace etl
{
is_truncated = false;
}
#endif
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
//*************************************************************************
/// Sets the 'secure' flag to the requested state.
//*************************************************************************
@ -249,18 +250,24 @@ namespace etl
{
return clear_afer_use;
}
#endif
protected:
//*************************************************************************
/// Constructor.
//*************************************************************************
string_base(size_t max_size_)
: is_truncated(false)
, clear_afer_use(false)
, current_size(0)
string_base(size_type max_size_)
: current_size(0)
, CAPACITY(max_size_)
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = false;
#endif
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
clear_afer_use = false;
#endif
}
//*************************************************************************
@ -270,10 +277,16 @@ namespace etl
{
}
bool is_truncated; ///< Set to true if the operation truncated the string.
bool clear_afer_use; ///< Set to true if the string must be cleared after use.
size_type current_size; ///< The current number of elements in the string.
const size_type CAPACITY; ///< The maximum number of elements in the string.
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
bool is_truncated; ///< Set to true if the operation truncated the string.
#endif
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
bool clear_afer_use; ///< Set to true if the string must be cleared after use.
#endif
};
//***************************************************************************
@ -297,7 +310,6 @@ namespace etl
typedef const T* const_iterator;
typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
typedef size_t size_type;
typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
@ -414,7 +426,7 @@ namespace etl
/// If asserts or exceptions are enabled and the new size is larger than the
///\param new_size The new size.
//*********************************************************************
void resize(size_t new_size)
void resize(size_type new_size)
{
resize(new_size, 0);
}
@ -424,14 +436,16 @@ namespace etl
///\param new_size The new size.
///\param value The value to fill new elements with. Default = default constructed value.
//*********************************************************************
void resize(size_t new_size, T value)
void resize(size_type new_size, T value)
{
if (new_size > CAPACITY)
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
@ -453,7 +467,7 @@ namespace etl
///\param i The index.
///\return A reference to the value at index 'i'
//*********************************************************************
reference operator [](size_t i)
reference operator [](size_type i)
{
return p_buffer[i];
}
@ -463,7 +477,7 @@ namespace etl
///\param i The index.
///\return A const reference to the value at index 'i'
//*********************************************************************
const_reference operator [](size_t i) const
const_reference operator [](size_type i) const
{
return p_buffer[i];
}
@ -474,7 +488,7 @@ namespace etl
///\param i The index.
///\return A reference to the value at index 'i'
//*********************************************************************
reference at(size_t i)
reference at(size_type i)
{
ETL_ASSERT(i < size(), ETL_ERROR(string_out_of_bounds));
return p_buffer[i];
@ -486,7 +500,7 @@ namespace etl
///\param i The index.
///\return A const reference to the value at index 'i'
//*********************************************************************
const_reference at(size_t i) const
const_reference at(size_type i) const
{
ETL_ASSERT(i < size(), ETL_ERROR(string_out_of_bounds));
return p_buffer[i];
@ -555,6 +569,7 @@ namespace etl
{
assign(other.begin(), other.end());
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
is_truncated = true;
@ -563,6 +578,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
cleanup();
}
@ -574,7 +590,7 @@ namespace etl
///\param subposition The position to start from.
///\param sublength The length to copy.
//*********************************************************************
void assign(const etl::ibasic_string<T>& other, size_t subposition, size_t sublength)
void assign(const etl::ibasic_string<T>& other, size_type subposition, size_type sublength)
{
if (sublength == npos)
{
@ -600,10 +616,12 @@ namespace etl
p_buffer[current_size++] = *other++;
}
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = (*other != 0);
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ASSERT(is_truncated == false, ETL_ERROR(string_truncation))
#endif
#endif
p_buffer[current_size] = 0;
@ -615,14 +633,16 @@ namespace etl
///\param other The other string.
///\param length The length to copy.
//*********************************************************************
void assign(const_pointer other, size_t length_)
void assign(const_pointer other, size_type length_)
{
initialise();
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = (length_ > CAPACITY);
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ASSERT(is_truncated == false, ETL_ERROR(string_truncation))
#endif
#endif
length_ = etl::min(length_, CAPACITY);
@ -657,10 +677,12 @@ namespace etl
p_buffer[current_size] = 0;
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = (first != last);
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ASSERT(is_truncated == false, ETL_ERROR(string_truncation))
#endif
#endif
}
@ -670,14 +692,16 @@ namespace etl
///\param n The number of elements to add.
///\param value The value to insert for each element.
//*********************************************************************
void assign(size_t n, T value)
void assign(size_type n, T value)
{
initialise();
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = (n > CAPACITY);
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ASSERT(is_truncated == false, ETL_ERROR(string_truncation))
#endif
#endif
n = etl::min(n, CAPACITY);
@ -709,10 +733,12 @@ namespace etl
}
else
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
}
@ -737,6 +763,7 @@ namespace etl
{
insert(end(), str.begin(), str.end());
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (str.truncated())
{
is_truncated = true;
@ -745,6 +772,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
return *this;
}
@ -755,7 +783,7 @@ namespace etl
///\param subposition The position in str.
///\param sublength The number of characters.
//*********************************************************************
ibasic_string& append(const ibasic_string& str, size_t subposition, size_t sublength = npos)
ibasic_string& append(const ibasic_string& str, size_type subposition, size_type sublength = npos)
{
ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds));
@ -779,7 +807,7 @@ namespace etl
///\param str The string to append.
///\param n The number of characters.
//*********************************************************************
ibasic_string& append(const T* str, size_t n)
ibasic_string& append(const T* str, size_type n)
{
insert(size(), str, n);
return *this;
@ -790,7 +818,7 @@ namespace etl
///\param n The number of characters.
///\param c The character.
//*********************************************************************
ibasic_string& append(size_t n, T c)
ibasic_string& append(size_type n, T c)
{
insert(size(), n, c);
return *this;
@ -845,10 +873,12 @@ namespace etl
*insert_position = value;
}
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
@ -863,7 +893,7 @@ namespace etl
///\param n The number of elements to add.
///\param value The value to insert.
//*********************************************************************
void insert(const_iterator position, size_t n, T value)
void insert(const_iterator position, size_type n, T value)
{
if (n == 0)
{
@ -872,15 +902,17 @@ namespace etl
// Quick hack, as iterators are pointers.
iterator insert_position = const_cast<iterator>(position);
const size_t start = etl::distance(cbegin(), position);
const size_type start = etl::distance(cbegin(), position);
// No effect.
if (start >= CAPACITY)
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
return;
}
@ -890,10 +922,12 @@ namespace etl
{
if ((current_size + n) > CAPACITY)
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
@ -903,20 +937,23 @@ namespace etl
else
{
// Lets do some shifting.
const size_t shift_amount = n;
const size_t to_position = start + shift_amount;
const size_t remaining_characters = current_size - start;
const size_t max_shift_characters = CAPACITY - start - shift_amount;
const size_t characters_to_shift = etl::min(max_shift_characters, remaining_characters);
const size_type shift_amount = n;
const size_type to_position = start + shift_amount;
const size_type remaining_characters = current_size - start;
const size_type max_shift_characters = CAPACITY - start - shift_amount;
const size_type characters_to_shift = etl::min(max_shift_characters, remaining_characters);
// Will the string truncate?
if ((start + shift_amount + remaining_characters) > CAPACITY)
{
current_size = CAPACITY;
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
else
@ -946,16 +983,18 @@ namespace etl
return;
}
const size_t start = etl::distance(begin(), position);
const size_t n = etl::distance(first, last);
const size_type start = etl::distance(begin(), position);
const size_type n = etl::distance(first, last);
// No effect.
if (start >= CAPACITY)
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
return;
}
@ -965,10 +1004,12 @@ namespace etl
{
if (((current_size + n) > CAPACITY))
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
@ -982,20 +1023,23 @@ namespace etl
else
{
// Lets do some shifting.
const size_t shift_amount = n;
const size_t to_position = start + shift_amount;
const size_t remaining_characters = current_size - start;
const size_t max_shift_characters = CAPACITY - start - shift_amount;
const size_t characters_to_shift = etl::min(max_shift_characters, remaining_characters);
const size_type shift_amount = n;
const size_type to_position = start + shift_amount;
const size_type remaining_characters = current_size - start;
const size_type max_shift_characters = CAPACITY - start - shift_amount;
const size_type characters_to_shift = etl::min(max_shift_characters, remaining_characters);
// Will the string truncate?
if ((start + shift_amount + remaining_characters) > CAPACITY)
{
current_size = CAPACITY;
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
else
@ -1019,12 +1063,13 @@ namespace etl
///\param position The position to insert before.
///\param str The string to insert.
//*********************************************************************
etl::ibasic_string<T>& insert(size_t position, const etl::ibasic_string<T>& str)
etl::ibasic_string<T>& insert(size_type position, const etl::ibasic_string<T>& str)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
insert(begin() + position, str.cbegin(), str.cend());
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (str.truncated())
{
is_truncated = true;
@ -1033,6 +1078,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
return *this;
}
@ -1044,7 +1090,7 @@ namespace etl
///\param subposition The subposition to start from.
///\param sublength The number of characters to insert.
//*********************************************************************
etl::ibasic_string<T>& insert(size_t position, const etl::ibasic_string<T>& str, size_t subposition, size_t sublength)
etl::ibasic_string<T>& insert(size_type position, const etl::ibasic_string<T>& str, size_type subposition, size_type sublength)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds));
@ -1056,6 +1102,7 @@ namespace etl
insert(begin() + position, str.cbegin() + subposition, str.cbegin() + subposition + sublength);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (str.truncated())
{
is_truncated = true;
@ -1064,6 +1111,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
return *this;
}
@ -1073,7 +1121,7 @@ namespace etl
///\param position The position to insert before.
///\param s The string to insert.
//*********************************************************************
etl::ibasic_string<T>& insert(size_t position, const_pointer s)
etl::ibasic_string<T>& insert(size_type position, const_pointer s)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1087,7 +1135,7 @@ namespace etl
///\param s The string to insert.
///\param n The number of characters to insert.
//*********************************************************************
etl::ibasic_string<T>& insert(size_t position, const_pointer s, size_t n)
etl::ibasic_string<T>& insert(size_type position, const_pointer s, size_type n)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1101,7 +1149,7 @@ namespace etl
///\param n The number of characters to insert.
///\param c The character to insert.
//*********************************************************************
etl::ibasic_string<T>& insert(size_t position, size_t n, value_type c)
etl::ibasic_string<T>& insert(size_type position, size_type n, value_type c)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1115,7 +1163,7 @@ namespace etl
///\param length Number of characters.
///\return A refernce to this string.
//*********************************************************************
etl::ibasic_string<T>& erase(size_t position, size_t length_ = npos)
etl::ibasic_string<T>& erase(size_type position, size_type length_ = npos)
{
// Limit the length.
length_ = etl::min(length_, size() - position);
@ -1154,7 +1202,7 @@ namespace etl
}
etl::copy(last, end(), first);
size_t n_delete = etl::distance(first, last);
size_type n_delete = etl::distance(first, last);
current_size -= n_delete;
p_buffer[current_size] = 0;
@ -1177,20 +1225,22 @@ namespace etl
///\param len The number of characters to copy.
///\param pos The position to start copying from.
//*********************************************************************
size_t copy(pointer s, size_t len, size_t pos = 0)
size_type copy(pointer s, size_type len, size_type pos = 0)
{
if ((pos + len > size()))
{
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = true;
#if defined(ETL_STRING_TRUNCATION_IS_ERROR)
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
#endif
}
size_t endpos = etl::min(pos + len, size());
size_type endpos = etl::min(pos + len, size());
for (size_t i = pos; i < endpos; ++i)
for (size_type i = pos; i < endpos; ++i)
{
*s++ = p_buffer[i];
}
@ -1203,7 +1253,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find(const ibasic_string<T>& str, size_t pos = 0) const
size_type find(const ibasic_string<T>& str, size_type pos = 0) const
{
if ((pos + str.size()) > size())
{
@ -1227,7 +1277,7 @@ namespace etl
///\param s Pointer to the content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find(const_pointer s, size_t pos = 0) const
size_type find(const_pointer s, size_type pos = 0) const
{
#if defined(ETL_DEBUG)
if ((pos + etl::strlen(s)) > size())
@ -1254,7 +1304,7 @@ namespace etl
///\param pos The position to start searching from.
///\param n The number of characters to search for.
//*********************************************************************
size_t find(const_pointer s, size_t pos, size_t n) const
size_type find(const_pointer s, size_type pos, size_type n) const
{
#if defined(ETL_DEBUG)
if ((pos + etl::strlen(s) - n) > size())
@ -1280,7 +1330,7 @@ namespace etl
///\param c The character to find.
///\param position The position to start searching from.
//*********************************************************************
size_t find(T c, size_t position = 0) const
size_type find(T c, size_type position = 0) const
{
const_iterator i = etl::find(begin() + position, end(), c);
@ -1299,7 +1349,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t rfind(const ibasic_string<T>& str, size_t position = npos) const
size_type rfind(const ibasic_string<T>& str, size_type position = npos) const
{
if ((str.size()) > size())
{
@ -1330,9 +1380,9 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t rfind(const_pointer s, size_t position = npos) const
size_type rfind(const_pointer s, size_type position = npos) const
{
size_t len = etl::strlen(s);
size_type len = etl::strlen(s);
if (len > size())
{
@ -1366,7 +1416,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t rfind(const_pointer s, size_t position, size_t length_) const
size_type rfind(const_pointer s, size_type position, size_type length_) const
{
if (length_ > size())
{
@ -1400,7 +1450,7 @@ namespace etl
///\param c The character to find
///\param pos The position to start searching from.
//*********************************************************************
size_t rfind(T c, size_t position = npos) const
size_type rfind(T c, size_type position = npos) const
{
if (position >= size())
{
@ -1427,7 +1477,7 @@ namespace etl
///\param length The number of characters to replace.
///\param str The string to replace it with.
//*********************************************************************
ibasic_string& replace(size_t position, size_t length_, const ibasic_string& str)
ibasic_string& replace(size_type position, size_type length_, const ibasic_string& str)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1461,6 +1511,7 @@ namespace etl
// Insert the new stuff.
insert(first_, str.begin(), str.end());
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (str.truncated())
{
is_truncated = true;
@ -1469,6 +1520,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
return *this;
}
@ -1476,7 +1528,7 @@ namespace etl
//*********************************************************************
/// Replace characters from 'position' of 'length' with 'str' from 'subpsotion' of 'sublength'.
//*********************************************************************
ibasic_string& replace(size_t position, size_t length_, const ibasic_string& str, size_t subposition, size_t sublength)
ibasic_string& replace(size_type position, size_type length_, const ibasic_string& str, size_type subposition, size_type sublength)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds));
@ -1491,6 +1543,7 @@ namespace etl
// Insert the new stuff.
insert(position, str, subposition, sublength);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (str.truncated())
{
is_truncated = true;
@ -1499,6 +1552,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
return *this;
}
@ -1506,7 +1560,7 @@ namespace etl
//*********************************************************************
/// Replace characters from 'position' of 'length' with pointed to string.
//*********************************************************************
ibasic_string& replace(size_t position, size_t length_, const_pointer s)
ibasic_string& replace(size_type position, size_type length_, const_pointer s)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1543,7 +1597,7 @@ namespace etl
//*********************************************************************
/// Replace characters from 'position' of 'length' with 'n' characters from pointed to string.
//*********************************************************************
ibasic_string& replace(size_t position, size_t length_, const_pointer s, size_t n)
ibasic_string& replace(size_type position, size_type length_, const_pointer s, size_type n)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1562,7 +1616,7 @@ namespace etl
//*********************************************************************
/// Replace characters from 'first' to 'last' with 'n' characters from pointed to string.
//*********************************************************************
ibasic_string& replace(const_iterator first, const_iterator last, const_pointer s, size_t n)
ibasic_string& replace(const_iterator first, const_iterator last, const_pointer s, size_type n)
{
// Quick hack, as iterators are pointers.
iterator first_ = const_cast<iterator>(first);
@ -1580,7 +1634,7 @@ namespace etl
//*********************************************************************
/// Replace characters from 'position' of 'length' with 'n' copies of 'c'.
//*********************************************************************
ibasic_string& replace(size_t position, size_t length_, size_t n, value_type c)
ibasic_string& replace(size_type position, size_type length_, size_type n, value_type c)
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1599,7 +1653,7 @@ namespace etl
//*********************************************************************
/// Replace characters from 'first' of 'last' with 'n' copies of 'c'.
//*********************************************************************
ibasic_string& replace(const_iterator first, const_iterator last, size_t n, value_type c)
ibasic_string& replace(const_iterator first, const_iterator last, size_type n, value_type c)
{
// Quick hack, as iterators are pointers.
iterator first_ = const_cast<iterator>(first);
@ -1647,7 +1701,7 @@ namespace etl
//*************************************************************************
/// Compare position / length with string.
//*************************************************************************
int compare(size_t position, size_t length_, const ibasic_string& str) const
int compare(size_type position, size_type length_, const ibasic_string& str) const
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
@ -1663,7 +1717,7 @@ namespace etl
//*************************************************************************
/// Compare position / length with string / subposition / sublength.
//*************************************************************************
int compare(size_t position, size_t length_, const ibasic_string& str, size_t subposition, size_t sublength) const
int compare(size_type position, size_type length_, const ibasic_string& str, size_type subposition, size_type sublength) const
{
ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds));
ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds));
@ -1692,7 +1746,7 @@ namespace etl
//*************************************************************************
/// Compare position / length with C string.
//*************************************************************************
int compare(size_t position, size_t length_, const_pointer s) const
int compare(size_type position, size_type length_, const_pointer s) const
{
return compare(p_buffer + position,
p_buffer + position + length_,
@ -1703,7 +1757,7 @@ namespace etl
//*************************************************************************
/// Compare position / length with C string / n.
//*************************************************************************
int compare(size_t position, size_t length_, const_pointer s, size_t n) const
int compare(size_type position, size_type length_, const_pointer s, size_type n) const
{
return compare(p_buffer + position,
p_buffer + position + length_,
@ -1716,7 +1770,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_first_of(const ibasic_string<T>& str, size_t position = 0) const
size_type find_first_of(const ibasic_string<T>& str, size_type position = 0) const
{
return find_first_of(str.c_str(), position, str.size());
}
@ -1726,7 +1780,7 @@ namespace etl
///\param s Pointer to the content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_first_of(const_pointer s, size_t position = 0) const
size_type find_first_of(const_pointer s, size_type position = 0) const
{
return find_first_of(s, position, etl::strlen(s));
}
@ -1737,13 +1791,13 @@ namespace etl
///\param pos The position to start searching from.
///\param n The number of characters to search for.
//*********************************************************************
size_t find_first_of(const_pointer s, size_t position, size_t n) const
size_type find_first_of(const_pointer s, size_type position, size_type n) const
{
if (position < size())
{
for (size_t i = position; i < size(); ++i)
for (size_type i = position; i < size(); ++i)
{
for (size_t j = 0; j < n; ++j)
for (size_type j = 0; j < n; ++j)
{
if (p_buffer[i] == s[j])
{
@ -1761,11 +1815,11 @@ namespace etl
///\param c The character to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_first_of(value_type c, size_t position = 0) const
size_type find_first_of(value_type c, size_type position = 0) const
{
if (position < size())
{
for (size_t i = position; i < size(); ++i)
for (size_type i = position; i < size(); ++i)
{
if (p_buffer[i] == c)
{
@ -1782,7 +1836,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_last_of(const ibasic_string<T>& str, size_t position = npos) const
size_type find_last_of(const ibasic_string<T>& str, size_type position = npos) const
{
return find_last_of(str.c_str(), position, str.size());
}
@ -1792,7 +1846,7 @@ namespace etl
///\param s Pointer to the content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_last_of(const_pointer s, size_t position = npos) const
size_type find_last_of(const_pointer s, size_type position = npos) const
{
return find_last_of(s, position, etl::strlen(s));
}
@ -1803,7 +1857,7 @@ namespace etl
///\param pos The position to start searching from.
///\param n The number of characters to search for.
//*********************************************************************
size_t find_last_of(const_pointer s, size_t position, size_t n) const
size_type find_last_of(const_pointer s, size_type position, size_type n) const
{
if (empty())
{
@ -1816,7 +1870,7 @@ namespace etl
while (it != rend())
{
for (size_t j = 0; j < n; ++j)
for (size_type j = 0; j < n; ++j)
{
if (p_buffer[position] == s[j])
{
@ -1836,7 +1890,7 @@ namespace etl
///\param c The character to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_last_of(value_type c, size_t position = npos) const
size_type find_last_of(value_type c, size_type position = npos) const
{
if (empty())
{
@ -1866,7 +1920,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_first_not_of(const ibasic_string<T>& str, size_t position = 0) const
size_type find_first_not_of(const ibasic_string<T>& str, size_type position = 0) const
{
return find_first_not_of(str.c_str(), position, str.size());
}
@ -1876,7 +1930,7 @@ namespace etl
///\param s Pointer to the content to not find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_first_not_of(const_pointer s, size_t position = 0) const
size_type find_first_not_of(const_pointer s, size_type position = 0) const
{
return find_first_not_of(s, position, etl::strlen(s));
}
@ -1887,15 +1941,15 @@ namespace etl
///\param pos The position to start searching from.
///\param n The number of characters to search for.
//*********************************************************************
size_t find_first_not_of(const_pointer s, size_t position, size_t n) const
size_type find_first_not_of(const_pointer s, size_type position, size_type n) const
{
if (position < size())
{
for (size_t i = position; i < size(); ++i)
for (size_type i = position; i < size(); ++i)
{
bool found = false;
for (size_t j = 0; j < n; ++j)
for (size_type j = 0; j < n; ++j)
{
if (p_buffer[i] == s[j])
{
@ -1918,11 +1972,11 @@ namespace etl
///\param c The character to not find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_first_not_of(value_type c, size_t position = 0) const
size_type find_first_not_of(value_type c, size_type position = 0) const
{
if (position < size())
{
for (size_t i = position; i < size(); ++i)
for (size_type i = position; i < size(); ++i)
{
if (p_buffer[i] != c)
{
@ -1939,7 +1993,7 @@ namespace etl
///\param str The content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_last_not_of(const ibasic_string<T>& str, size_t position = npos) const
size_type find_last_not_of(const ibasic_string<T>& str, size_type position = npos) const
{
return find_last_not_of(str.c_str(), position, str.size());
}
@ -1949,7 +2003,7 @@ namespace etl
///\param s The pointer to the content to find
///\param pos The position to start searching from.
//*********************************************************************
size_t find_last_not_of(const_pointer s, size_t position = npos) const
size_type find_last_not_of(const_pointer s, size_type position = npos) const
{
return find_last_not_of(s, position, etl::strlen(s));
}
@ -1960,7 +2014,7 @@ namespace etl
///\param pos The position to start searching from.
///\param n The number of characters to use.
//*********************************************************************
size_t find_last_not_of(const_pointer s, size_t position, size_t n) const
size_type find_last_not_of(const_pointer s, size_type position, size_type n) const
{
if (empty())
{
@ -1975,7 +2029,7 @@ namespace etl
{
bool found = false;
for (size_t j = 0; j < n; ++j)
for (size_type j = 0; j < n; ++j)
{
if (p_buffer[position] == s[j])
{
@ -1998,7 +2052,7 @@ namespace etl
//*********************************************************************
//
//*********************************************************************
size_t find_last_not_of(value_type c, size_t position = npos) const
size_type find_last_not_of(value_type c, size_type position = npos) const
{
if (empty())
{
@ -2071,7 +2125,7 @@ namespace etl
//*************************************************************************
ibasic_string& operator += (T rhs)
{
append(size_t(1), rhs);
append(size_type(1), rhs);
return *this;
}
@ -2088,7 +2142,7 @@ namespace etl
//*********************************************************************
/// Constructor.
//*********************************************************************
ibasic_string(T* p_buffer_, size_t MAX_SIZE_)
ibasic_string(T* p_buffer_, size_type MAX_SIZE_)
: string_base(MAX_SIZE_),
p_buffer(p_buffer_)
{
@ -2102,7 +2156,9 @@ namespace etl
current_size = 0;
cleanup();
p_buffer[0] = 0;
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
is_truncated = false;
#endif
}
//*************************************************************************
@ -2160,10 +2216,12 @@ namespace etl
//*************************************************************************
void cleanup()
{
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
if (is_secure())
{
etl::memory_clear_range(&p_buffer[current_size], &p_buffer[CAPACITY]);
}
#endif
}
//*************************************************************************
@ -2187,10 +2245,12 @@ namespace etl
#endif
~ibasic_string()
{
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
if (is_secure())
{
initialise();
}
#endif
}
};

View File

@ -101,6 +101,20 @@ SOFTWARE.
#define ETL_EXPLICIT_STRING_FROM_CHAR
#endif
// Option to disable truncation checks for strings.
#if defined(ETL_DISABLE_STRING_TRUNCATION_CHECKS)
#define ETL_STRING_TRUNCATION_CHECKS_ENABLED 0
#else
#define ETL_STRING_TRUNCATION_CHECKS_ENABLED 1
#endif
// Option to disable clear-after-use functionality for strings.
#if defined(ETL_DISABLE_STRING_CLEAR_AFTER_USE)
#define ETL_STRING_CLEAR_AFTER_USE_ENABLED 0
#else
#define ETL_STRING_CLEAR_AFTER_USE_ENABLED 1
#endif
// The macros below are dependent on the profile.
// C++11
#if ETL_CPP11_SUPPORTED && !defined(ETL_FORCE_NO_ADVANCED_CPP)

View File

@ -105,6 +105,7 @@ namespace etl
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -113,6 +114,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
}
//*************************************************************************
@ -141,7 +143,7 @@ namespace etl
///\param initialSize The initial size of the string.
///\param value The value to fill the string with.
//*************************************************************************
string(size_t count, value_type c)
string(size_type count, value_type c)
: istring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->initialise();
@ -187,7 +189,7 @@ namespace etl
///\param position The position of the first character. Default = 0.
///\param length The number of characters. Default = npos.
//*************************************************************************
etl::string<MAX_SIZE_> substr(size_t position = 0, size_t length_ = npos) const
etl::string<MAX_SIZE_> substr(size_type position = 0, size_type length_ = npos) const
{
etl::string<MAX_SIZE_> new_string;
@ -270,11 +272,12 @@ namespace etl
typedef istring interface_type;
typedef istring::value_type value_type;
typedef istring::size_type size_type;
//*************************************************************************
/// Constructor.
//*************************************************************************
string(value_type* buffer, size_t buffer_size)
string(value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->initialise();
@ -284,7 +287,7 @@ namespace etl
/// Copy constructor.
///\param other The other string.
//*************************************************************************
string(const etl::string<0U>& other, value_type* buffer, size_t buffer_size)
string(const etl::string<0U>& other, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->assign(other);
@ -294,7 +297,7 @@ namespace etl
/// From other istring.
///\param other The other istring.
//*************************************************************************
string(const etl::istring& other, value_type* buffer, size_t buffer_size)
string(const etl::istring& other, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->assign(other);
@ -306,13 +309,14 @@ namespace etl
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
string(const etl::istring& other, value_type* buffer, size_t buffer_size, size_t position, size_t length_ = npos)
string(const etl::istring& other, value_type* buffer, size_type buffer_size, size_type position, size_type length_ = npos)
: istring(buffer, buffer_size - 1U)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -321,13 +325,14 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
}
//*************************************************************************
/// Constructor, from null terminated text.
///\param text The initial text of the string.
//*************************************************************************
string(const value_type* text, value_type* buffer, size_t buffer_size)
string(const value_type* text, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
// Is the initial text at the same address as the buffer?
@ -346,7 +351,7 @@ namespace etl
///\param text The initial text of the string.
///\param count The number of characters to copy.
//*************************************************************************
string(const value_type* text, size_t count, value_type* buffer, size_t buffer_size)
string(const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->assign(text, text + count);
@ -357,7 +362,7 @@ namespace etl
///\param initialSize The initial size of the string.
///\param value The value to fill the string with.
//*************************************************************************
string(size_t count, value_type c, value_type* buffer, size_t buffer_size)
string(size_type count, value_type c, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->initialise();
@ -371,7 +376,7 @@ namespace etl
///\param last The iterator to the last element + 1.
//*************************************************************************
template <typename TIterator>
string(TIterator first, TIterator last, value_type* buffer, size_t buffer_size)
string(TIterator first, TIterator last, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->assign(first, last);
@ -381,7 +386,7 @@ namespace etl
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
string(std::initializer_list<value_type> init, value_type* buffer, size_t buffer_size)
string(std::initializer_list<value_type> init, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->assign(init.begin(), init.end());
@ -392,7 +397,7 @@ namespace etl
/// From string_view.
///\param view The string_view.
//*************************************************************************
explicit string(const etl::string_view& view, value_type* buffer, size_t buffer_size)
explicit string(const etl::string_view& view, value_type* buffer, size_type buffer_size)
: istring(buffer, buffer_size - 1U)
{
this->assign(view.begin(), view.end());
@ -456,7 +461,7 @@ namespace etl
size_t operator()(const etl::istring& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
@ -466,7 +471,7 @@ namespace etl
size_t operator()(const etl::string<SIZE>& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
#endif

View File

@ -113,7 +113,7 @@ namespace etl
template <typename TIString>
void trim_from_left(TIString& s, typename TIString::const_pointer trim_characters)
{
size_t position = s.find_first_not_of(trim_characters);
typename TIString::size_type position = s.find_first_not_of(trim_characters);
s.erase(0U, position);
}
@ -134,7 +134,7 @@ namespace etl
template <typename TStringView>
TStringView trim_from_view_left(const TStringView& view, typename TStringView::const_pointer trim_characters)
{
size_t first = view.find_first_not_of(trim_characters);
typename TStringView::size_type first = view.find_first_not_of(trim_characters);
typename TStringView::const_pointer pbegin = view.data() + view.size();
@ -163,7 +163,7 @@ namespace etl
template <typename TIString>
void trim_left(TIString& s, typename TIString::const_pointer delimiters)
{
size_t p = s.find_first_of(delimiters);
typename TIString::size_type p = s.find_first_of(delimiters);
if (p == TIString::npos)
{
@ -182,7 +182,7 @@ namespace etl
template <typename TStringView>
TStringView trim_view_left(const TStringView& view, typename TStringView::const_pointer delimiters)
{
size_t first = view.find_first_of(delimiters);
typename TStringView::size_type first = view.find_first_of(delimiters);
typename TStringView::const_pointer pbegin = view.data();
@ -193,7 +193,7 @@ namespace etl
}
else
{
return TStringView(pbegin, size_t(0U));
return TStringView(pbegin, typename TStringView::size_type(0U));
}
}
@ -224,7 +224,7 @@ namespace etl
template <typename TStringView>
TStringView trim_from_view_right(const TStringView& view, typename TStringView::const_pointer trim_characters)
{
size_t last = view.find_last_not_of(trim_characters) + 1;
typename TStringView::size_type last = view.find_last_not_of(trim_characters) + 1;
typename TStringView::const_pointer pend = view.data();
@ -252,7 +252,7 @@ namespace etl
template <typename TIString>
void trim_right(TIString& s, typename TIString::const_pointer delimiters)
{
size_t p = s.find_last_of(delimiters);
typename TIString::size_type p = s.find_last_of(delimiters);
if (p == TIString::npos)
{
@ -275,7 +275,7 @@ namespace etl
template <typename TStringView>
TStringView trim_view_right(const TStringView& view, typename TStringView::const_pointer delimiters)
{
size_t last = view.find_last_of(delimiters) + 1;
typename TStringView::size_type last = view.find_last_of(delimiters) + 1;
typename TStringView::const_pointer pend = view.data();
@ -286,7 +286,7 @@ namespace etl
}
else
{
return TStringView(view.data(), size_t(0U));
return TStringView(view.data(), typename TStringView::size_type(0U));
}
}
@ -318,8 +318,8 @@ namespace etl
template <typename TStringView>
TStringView trim_from_view(const TStringView& view, typename TStringView::const_pointer trim_characters)
{
size_t first = view.find_first_not_of(trim_characters);
size_t last = view.find_last_not_of(trim_characters) + 1;
typename TStringView::size_type first = view.find_first_not_of(trim_characters);
typename TStringView::size_type last = view.find_last_not_of(trim_characters) + 1;
typename TStringView::const_pointer pbegin = view.data();
typename TStringView::const_pointer pend = view.data();
@ -365,8 +365,8 @@ namespace etl
template <typename TStringView>
TStringView trim_view(const TStringView& view, typename TStringView::const_pointer delimiters)
{
size_t first = view.find_first_of(delimiters);
size_t last = view.find_last_of(delimiters) + 1;
typename TStringView::size_type first = view.find_first_of(delimiters);
typename TStringView::size_type last = view.find_last_of(delimiters) + 1;
typename TStringView::const_pointer pbegin = view.data();
typename TStringView::const_pointer pend = view.data();
@ -388,7 +388,7 @@ namespace etl
/// Get up to the first n characters.
//***************************************************************************
template <typename TIString>
void left_n(TIString& s, size_t n)
void left_n(TIString& s, typename TIString::size_type n)
{
n = (n > s.size()) ? s.size() : n;
@ -399,7 +399,7 @@ namespace etl
/// Get a view of up to the first n characters.
//***************************************************************************
template <typename TStringView>
TStringView left_n_view(const TStringView& view, size_t n)
TStringView left_n_view(const TStringView& view, typename TStringView::size_type n)
{
n = (n > view.size()) ? view.size() : n;
@ -410,7 +410,7 @@ namespace etl
/// Get up to the last n characters.
//***************************************************************************
template <typename TIString>
void right_n(TIString& s, size_t n)
void right_n(TIString& s, typename TIString::size_type n)
{
n = (n > s.size()) ? s.size() : n;
@ -421,7 +421,7 @@ namespace etl
/// Get a view of up to the last n characters.
//***************************************************************************
template <typename TStringView>
TStringView right_n_view(const TStringView& view, size_t n)
TStringView right_n_view(const TStringView& view, typename TStringView::size_type n)
{
n = (n > view.size()) ? view.size() : n;
@ -466,15 +466,15 @@ namespace etl
const typename TIString::value_type* p_old = pairsbegin->first;
const typename TIString::value_type* p_new = pairsbegin->second;
size_t position = 0U;
typename TIString::size_type position = 0U;
do
{
position = s.find(p_old, position);
if (position != TIString::npos)
{
s.replace(position, etl::strlen(p_old), p_new, etl::strlen(p_new));
position += etl::strlen(p_new);
s.replace(position, typename TIString::size_type(etl::strlen(p_old)), p_new, typename TIString::size_type(etl::strlen(p_new)));
position += typename TIString::size_type(etl::strlen(p_new));
}
} while (position != TIString::npos);
@ -703,7 +703,7 @@ namespace etl
typedef typename TInput::const_pointer const_pointer;
bool token_found = false;
size_t position = 0U;
typename TStringView::size_type position = 0U;
TStringView view = last_view.value_or(TStringView());
const_pointer begin_ptr = input.data();
@ -744,14 +744,14 @@ namespace etl
/// pad_left
//***************************************************************************
template <typename TIString>
void pad_left(TIString& s, size_t required_size, typename TIString::value_type pad_char)
void pad_left(TIString& s, typename TIString::size_type required_size, typename TIString::value_type pad_char)
{
required_size = etl::min(required_size, s.max_size());
if (required_size > s.size())
{
required_size -= s.size();
s.insert(size_t(0U), required_size, pad_char);
s.insert(typename TIString::size_type(0U), required_size, pad_char);
}
}
@ -759,7 +759,7 @@ namespace etl
/// pad_right
//***************************************************************************
template <typename TIString>
void pad_right(TIString& s, size_t required_size, typename TIString::value_type pad_char)
void pad_right(TIString& s, typename TIString::size_type required_size, typename TIString::value_type pad_char)
{
required_size = etl::min(required_size, s.max_size());
@ -774,7 +774,7 @@ namespace etl
/// pad
//***************************************************************************
template <typename TIString>
void pad(TIString& s, size_t required_size, string_pad_direction pad_direction, typename TIString::value_type pad_char)
void pad(TIString& s, typename TIString::size_type required_size, string_pad_direction pad_direction, typename TIString::value_type pad_char)
{
switch (int(pad_direction))
{

View File

@ -98,13 +98,14 @@ namespace etl
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
u16string(const etl::iu16string& other, size_t position, size_t length_ = npos)
u16string(const etl::iu16string& other, size_type position, size_type length_ = npos)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -113,6 +114,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
}
//*************************************************************************
@ -130,7 +132,7 @@ namespace etl
///\param text The initial text of the u16string.
///\param count The number of characters to copy.
//*************************************************************************
u16string(const value_type* text, size_t count)
u16string(const value_type* text, size_type count)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(text, text + count);
@ -141,7 +143,7 @@ namespace etl
///\param initialSize The initial size of the u16string.
///\param value The value to fill the u16string with.
//*************************************************************************
u16string(size_t count, value_type c)
u16string(size_type count, value_type c)
: iu16string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->initialise();
@ -187,7 +189,7 @@ namespace etl
///\param position The position of the first character. Default = 0.
///\param length The number of characters. Default = npos.
//*************************************************************************
etl::u16string<MAX_SIZE_> substr(size_t position = 0, size_t length_ = npos) const
etl::u16string<MAX_SIZE_> substr(size_type position = 0, size_type length_ = npos) const
{
etl::u16string<MAX_SIZE_> new_string;
@ -260,7 +262,7 @@ namespace etl
//*************************************************************************
/// Constructor.
//*************************************************************************
u16string(value_type* buffer, size_t buffer_size)
u16string(value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->initialise();
@ -270,7 +272,7 @@ namespace etl
/// Copy constructor.
///\param other The other u16string.
//*************************************************************************
u16string(const etl::u16string<0U>& other, value_type* buffer, size_t buffer_size)
u16string(const etl::u16string<0U>& other, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->assign(other);
@ -280,7 +282,7 @@ namespace etl
/// From other iu16string.
///\param other The other iu16string.
//*************************************************************************
u16string(const etl::iu16string& other, value_type* buffer, size_t buffer_size)
u16string(const etl::iu16string& other, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->assign(other);
@ -292,13 +294,14 @@ namespace etl
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
u16string(const etl::iu16string& other, value_type* buffer, size_t buffer_size, size_t position, size_t length_ = npos)
u16string(const etl::iu16string& other, value_type* buffer, size_type buffer_size, size_type position, size_type length_ = npos)
: iu16string(buffer, buffer_size - 1U)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -307,13 +310,14 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(u16string_truncation));
#endif
}
#endif
}
//*************************************************************************
/// Constructor, from null terminated text.
///\param text The initial text of the u16string.
//*************************************************************************
u16string(const value_type* text, value_type* buffer, size_t buffer_size)
u16string(const value_type* text, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
// Is the initial text at the same address as the buffer?
@ -332,7 +336,7 @@ namespace etl
///\param text The initial text of the u16string.
///\param count The number of characters to copy.
//*************************************************************************
u16string(const value_type* text, size_t count, value_type* buffer, size_t buffer_size)
u16string(const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->assign(text, text + count);
@ -343,7 +347,7 @@ namespace etl
///\param initialSize The initial size of the u16string.
///\param value The value to fill the u16string with.
//*************************************************************************
u16string(size_t count, value_type c, value_type* buffer, size_t buffer_size)
u16string(size_type count, value_type c, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->initialise();
@ -357,7 +361,7 @@ namespace etl
///\param last The iterator to the last element + 1.
//*************************************************************************
template <typename TIterator>
u16string(TIterator first, TIterator last, value_type* buffer, size_t buffer_size)
u16string(TIterator first, TIterator last, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->assign(first, last);
@ -367,7 +371,7 @@ namespace etl
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
u16string(std::initializer_list<value_type> init, value_type* buffer, size_t buffer_size)
u16string(std::initializer_list<value_type> init, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->assign(init.begin(), init.end());
@ -378,7 +382,7 @@ namespace etl
/// From u16string_view.
///\param view The u16string_view.
//*************************************************************************
explicit u16string(const etl::u16string_view& view, value_type* buffer, size_t buffer_size)
explicit u16string(const etl::u16string_view& view, value_type* buffer, size_type buffer_size)
: iu16string(buffer, buffer_size - 1U)
{
this->assign(view.begin(), view.end());
@ -442,7 +446,7 @@ namespace etl
size_t operator()(const etl::iu16string& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
@ -452,7 +456,7 @@ namespace etl
size_t operator()(const etl::u16string<SIZE>& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
#endif

View File

@ -98,13 +98,14 @@ namespace etl
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
u32string(const etl::iu32string& other, size_t position, size_t length_ = npos)
u32string(const etl::iu32string& other, size_type position, size_type length_ = npos)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -113,6 +114,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
}
//*************************************************************************
@ -130,7 +132,7 @@ namespace etl
///\param text The initial text of the u32string.
///\param count The number of characters to copy.
//*************************************************************************
u32string(const value_type* text, size_t count)
u32string(const value_type* text, size_type count)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(text, text + count);
@ -141,7 +143,7 @@ namespace etl
///\param initialSize The initial size of the u32string.
///\param value The value to fill the u32string with.
//*************************************************************************
u32string(size_t count, value_type c)
u32string(size_type count, value_type c)
: iu32string(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->initialise();
@ -187,7 +189,7 @@ namespace etl
///\param position The position of the first character. Default = 0.
///\param length The number of characters. Default = npos.
//*************************************************************************
etl::u32string<MAX_SIZE_> substr(size_t position = 0, size_t length_ = npos) const
etl::u32string<MAX_SIZE_> substr(size_type position = 0, size_type length_ = npos) const
{
etl::u32string<MAX_SIZE_> new_string;
@ -260,7 +262,7 @@ namespace etl
//*************************************************************************
/// Constructor.
//*************************************************************************
u32string(value_type* buffer, size_t buffer_size)
u32string(value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->initialise();
@ -270,7 +272,7 @@ namespace etl
/// Copy constructor.
///\param other The other u32string.
//*************************************************************************
u32string(const etl::u32string<0U>& other, value_type* buffer, size_t buffer_size)
u32string(const etl::u32string<0U>& other, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->assign(other);
@ -280,7 +282,7 @@ namespace etl
/// From other iu32string.
///\param other The other iu32string.
//*************************************************************************
u32string(const etl::iu32string& other, value_type* buffer, size_t buffer_size)
u32string(const etl::iu32string& other, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->assign(other);
@ -292,13 +294,14 @@ namespace etl
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
u32string(const etl::iu32string& other, value_type* buffer, size_t buffer_size, size_t position, size_t length_ = npos)
u32string(const etl::iu32string& other, value_type* buffer, size_type buffer_size, size_type position, size_type length_ = npos)
: iu32string(buffer, buffer_size - 1U)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -307,19 +310,20 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(u32string_truncation));
#endif
}
#endif
}
//*************************************************************************
/// Constructor, from null terminated text.
///\param text The initial text of the u32string.
//*************************************************************************
ETL_EXPLICIT_STRING_FROM_CHAR u32string(const value_type* text, value_type* buffer, size_t buffer_size)
ETL_EXPLICIT_STRING_FROM_CHAR u32string(const value_type* text, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
// Is the initial text at the same address as the buffer?
if (text == buffer)
{
this->current_size = etl::strlen(buffer);
this->current_size = etl::strlen(buffer);;
}
else
{
@ -332,7 +336,7 @@ namespace etl
///\param text The initial text of the u32string.
///\param count The number of characters to copy.
//*************************************************************************
u32string(const value_type* text, size_t count, value_type* buffer, size_t buffer_size)
u32string(const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->assign(text, text + count);
@ -343,7 +347,7 @@ namespace etl
///\param initialSize The initial size of the u32string.
///\param value The value to fill the u32string with.
//*************************************************************************
u32string(size_t count, value_type c, value_type* buffer, size_t buffer_size)
u32string(size_type count, value_type c, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->initialise();
@ -357,7 +361,7 @@ namespace etl
///\param last The iterator to the last element + 1.
//*************************************************************************
template <typename TIterator>
u32string(TIterator first, TIterator last, value_type* buffer, size_t buffer_size)
u32string(TIterator first, TIterator last, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->assign(first, last);
@ -367,7 +371,7 @@ namespace etl
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
u32string(std::initializer_list<value_type> init, value_type* buffer, size_t buffer_size)
u32string(std::initializer_list<value_type> init, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->assign(init.begin(), init.end());
@ -378,7 +382,7 @@ namespace etl
/// From u32string_view.
///\param view The u32string_view.
//*************************************************************************
explicit u32string(const etl::u32string_view& view, value_type* buffer, size_t buffer_size)
explicit u32string(const etl::u32string_view& view, value_type* buffer, size_type buffer_size)
: iu32string(buffer, buffer_size - 1U)
{
this->assign(view.begin(), view.end());
@ -442,7 +446,7 @@ namespace etl
size_t operator()(const etl::iu32string& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
@ -452,7 +456,7 @@ namespace etl
size_t operator()(const etl::u32string<SIZE>& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
#endif

View File

@ -92,20 +92,20 @@ namespace etl
this->assign(other);
}
//*************************************************************************
/// From other string, position, length.
///\param other The other string.
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
wstring(const etl::iwstring& other, size_t position, size_t length_ = npos)
wstring(const etl::iwstring& other, size_type position, size_type length_ = npos)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -114,6 +114,7 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation));
#endif
}
#endif
}
//*************************************************************************
@ -131,7 +132,7 @@ namespace etl
///\param text The initial text of the wstring.
///\param count The number of characters to copy.
//*************************************************************************
wstring(const value_type* text, size_t count)
wstring(const value_type* text, size_type count)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->assign(text, text + count);
@ -142,7 +143,7 @@ namespace etl
///\param initialSize The initial size of the wstring.
///\param value The value to fill the wstring with.
//*************************************************************************
wstring(size_t count, value_type c)
wstring(size_type count, value_type c)
: iwstring(reinterpret_cast<value_type*>(&buffer), MAX_SIZE)
{
this->initialise();
@ -188,7 +189,7 @@ namespace etl
///\param position The position of the first character. Default = 0.
///\param length The number of characters. Default = npos.
//*************************************************************************
etl::wstring<MAX_SIZE_> substr(size_t position = 0, size_t length_ = npos) const
etl::wstring<MAX_SIZE_> substr(size_type position = 0, size_type length_ = npos) const
{
etl::wstring<MAX_SIZE_> new_string;
@ -261,7 +262,7 @@ namespace etl
//*************************************************************************
/// Constructor.
//*************************************************************************
wstring(value_type* buffer, size_t buffer_size)
wstring(value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->initialise();
@ -271,7 +272,7 @@ namespace etl
/// Copy constructor.
///\param other The other wstring.
//*************************************************************************
wstring(const etl::wstring<0U>& other, value_type* buffer, size_t buffer_size)
wstring(const etl::wstring<0U>& other, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->assign(other);
@ -281,7 +282,7 @@ namespace etl
/// From other iwstring.
///\param other The other iwstring.
//*************************************************************************
wstring(const etl::iwstring& other, value_type* buffer, size_t buffer_size)
wstring(const etl::iwstring& other, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->assign(other);
@ -293,13 +294,14 @@ namespace etl
///\param position The position of the first character.
///\param length The number of characters. Default = npos.
//*************************************************************************
wstring(const etl::iwstring& other, value_type* buffer, size_t buffer_size, size_t position, size_t length_ = npos)
wstring(const etl::iwstring& other, value_type* buffer, size_type buffer_size, size_type position, size_type length_ = npos)
: iwstring(buffer, buffer_size - 1U)
{
ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds));
this->assign(other.begin() + position, other.begin() + position + length_);
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
if (other.truncated())
{
this->is_truncated = true;
@ -308,13 +310,14 @@ namespace etl
ETL_ALWAYS_ASSERT(ETL_ERROR(wstring_truncation));
#endif
}
#endif
}
//*************************************************************************
/// Constructor, from null terminated text.
///\param text The initial text of the wstring.
//*************************************************************************
wstring(const value_type* text, value_type* buffer, size_t buffer_size)
wstring(const value_type* text, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
// Is the initial text at the same address as the buffer?
@ -333,7 +336,7 @@ namespace etl
///\param text The initial text of the wstring.
///\param count The number of characters to copy.
//*************************************************************************
wstring(const value_type* text, size_t count, value_type* buffer, size_t buffer_size)
wstring(const value_type* text, size_type count, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->assign(text, text + count);
@ -344,7 +347,7 @@ namespace etl
///\param initialSize The initial size of the wstring.
///\param value The value to fill the wstring with.
//*************************************************************************
wstring(size_t count, value_type c, value_type* buffer, size_t buffer_size)
wstring(size_type count, value_type c, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->initialise();
@ -358,7 +361,7 @@ namespace etl
///\param last The iterator to the last element + 1.
//*************************************************************************
template <typename TIterator>
wstring(TIterator first, TIterator last, value_type* buffer, size_t buffer_size)
wstring(TIterator first, TIterator last, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->assign(first, last);
@ -368,7 +371,7 @@ namespace etl
//*************************************************************************
/// Construct from initializer_list.
//*************************************************************************
wstring(std::initializer_list<value_type> init, value_type* buffer, size_t buffer_size)
wstring(std::initializer_list<value_type> init, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->assign(init.begin(), init.end());
@ -379,7 +382,7 @@ namespace etl
/// From wstring_view.
///\param view The wstring_view.
//*************************************************************************
explicit wstring(const etl::wstring_view& view, value_type* buffer, size_t buffer_size)
explicit wstring(const etl::wstring_view& view, value_type* buffer, size_type buffer_size)
: iwstring(buffer, buffer_size - 1U)
{
this->assign(view.begin(), view.end());
@ -443,7 +446,7 @@ namespace etl
size_t operator()(const etl::iwstring& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
@ -453,7 +456,7 @@ namespace etl
size_t operator()(const etl::wstring<SIZE>& text) const
{
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
reinterpret_cast<const uint8_t*>(&text[text.size()]));
reinterpret_cast<const uint8_t*>(&text[text.size()]));
}
};
#endif

View File

@ -127,6 +127,29 @@
<Add after="${TARGET_OUTPUT_DIR}${TARGET_OUTPUT_BASENAME}" />
</ExtraCommands>
</Target>
<Target title="Windows Small Strings">
<Option output="bin/Debug/ETL" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-std=c++14" />
<Add option="-std=c++17" />
<Add option="-std=c++11" />
<Add option="-m32" />
<Add option="-g" />
<Add option="-D_DEBUG" />
<Add option="-DETL_DISABLE_STRING_TRUNCATION_CHECKS" />
<Add option="-DETL_DISABLE_STRING_CLEAR_AFTER_USE" />
<Add directory="../../src" />
</Compiler>
<Linker>
<Add option="-m32" />
</Linker>
<ExtraCommands>
<Add after="${TARGET_OUTPUT_DIR}${TARGET_OUTPUT_BASENAME}" />
</ExtraCommands>
</Target>
</Build>
<Compiler>
<Add option="-Wshadow" />
@ -211,6 +234,7 @@
<Option target="Windows 64" />
<Option target="Windows No STL" />
<Option target="Windows No STL - Force No Advanced" />
<Option target="Windows Small Strings" />
</Unit>
<Unit filename="../../../unittest-cpp/UnitTest++/Win32/TimeHelpers.h">
<Option target="&lt;{~None~}&gt;" />

View File

@ -87,19 +87,27 @@ namespace
CHECK_EQUAL(CAPACITY, ctext.max_size());
CHECK_EQUAL(length, ctext.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(!ctext.truncated());
#endif
CHECK_EQUAL(CAPACITY, wtext.max_size());
CHECK_EQUAL(length, wtext.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(!wtext.truncated());
#endif
CHECK_EQUAL(CAPACITY, u16text.max_size());
CHECK_EQUAL(length, u16text.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(!u16text.truncated());
#endif
CHECK_EQUAL(CAPACITY, u32text.max_size());
CHECK_EQUAL(length, u32text.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(!u32text.truncated());
#endif
CHECK(Equal(std::string("Hello World"), ctext));
CHECK(Equal(std::wstring(L"Hello World"), ctext));
@ -126,19 +134,27 @@ namespace
CHECK_EQUAL(CAPACITY, ctext.max_size());
CHECK_EQUAL(length - 1, ctext.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(ctext.truncated());
#endif
CHECK_EQUAL(CAPACITY, wtext.max_size());
CHECK_EQUAL(length - 1, wtext.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(wtext.truncated());
#endif
CHECK_EQUAL(CAPACITY, u16text.max_size());
CHECK_EQUAL(length - 1, u16text.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(u16text.truncated());
#endif
CHECK_EQUAL(CAPACITY, u32text.max_size());
CHECK_EQUAL(length - 1, u32text.size());
#if ETL_STRING_CLEAR_AFTER_USE_ENABLED
CHECK(u32text.truncated());
#endif
CHECK(Equal(std::string("Hello Worl"), ctext));
CHECK(Equal(std::wstring(L"Hello Worl"), ctext));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@ namespace
using StringView = etl::string_view;
using Char = etl::istring::value_type;
using Vector = etl::vector<String, 15>;
using SizeType = etl::istring::size_type;
constexpr auto Whitespace = etl::whitespace_v<String::value_type>;
@ -1102,7 +1103,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(SizeType(0U), text.capacity() - expected.size(), STR('x'));
etl::pad_left(text, text.capacity() + 1U, STR('x'));
@ -1170,7 +1171,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(SizeType(0U), text.capacity() - expected.size(), STR('x'));
etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x'));

View File

@ -1102,7 +1102,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(String::size_type(0U), text.capacity() - expected.size(), STR('x'));
etl::pad_left(text, text.capacity() + 1U, STR('x'));
@ -1170,7 +1170,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(String::size_type(0U), text.capacity() - expected.size(), STR('x'));
etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x'));

View File

@ -1102,7 +1102,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(String::size_type(0U), text.capacity() - expected.size(), STR('x'));
etl::pad_left(text, text.capacity() + 1U, STR('x'));
@ -1170,7 +1170,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(String::size_type(0U), text.capacity() - expected.size(), STR('x'));
etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x'));

View File

@ -1102,7 +1102,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(String::size_type(0U), text.capacity() - expected.size(), STR('x'));
etl::pad_left(text, text.capacity() + 1U, STR('x'));
@ -1170,7 +1170,7 @@ namespace
{
String text(STR("Hello World"));
String expected(text);
expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x'));
expected.insert(String::size_type(0U), text.capacity() - expected.size(), STR('x'));
etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x'));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@ Global
Debug MSVC - No STL|x64 = Debug MSVC - No STL|x64
Debug MSVC - No Unit Tests|Win32 = Debug MSVC - No Unit Tests|Win32
Debug MSVC - No Unit Tests|x64 = Debug MSVC - No Unit Tests|x64
Debug MSVC - Small Strings|Win32 = Debug MSVC - Small Strings|Win32
Debug MSVC - Small Strings|x64 = Debug MSVC - Small Strings|x64
Debug MSVC - String Truncation Is Error|Win32 = Debug MSVC - String Truncation Is Error|Win32
Debug MSVC - String Truncation Is Error|x64 = Debug MSVC - String Truncation Is Error|x64
Debug MSVC 64|Win32 = Debug MSVC 64|Win32
@ -55,6 +57,10 @@ Global
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No Unit Tests|Win32.Build.0 = Debug No Unit Tests|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No Unit Tests|x64.ActiveCfg = Debug No Unit Tests|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - No Unit Tests|x64.Build.0 = Debug No Unit Tests|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|Win32.ActiveCfg = DebugMSVCSmallStrings|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|Win32.Build.0 = DebugMSVCSmallStrings|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|x64.ActiveCfg = DebugMSVCSmallStrings|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - Small Strings|x64.Build.0 = DebugMSVCSmall Strings|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|Win32.ActiveCfg = DebugStringTruncationIsError|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|Win32.Build.0 = DebugStringTruncationIsError|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|x64.ActiveCfg = DebugStringTruncationIsError|x64

View File

@ -17,6 +17,14 @@
<Configuration>Debug LLVM</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugMSVCSmallStrings|Win32">
<Configuration>DebugMSVCSmallStrings</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugMSVCSmallStrings|x64">
<Configuration>DebugMSVCSmallStrings</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug MSVC No Checks|Win32">
<Configuration>Debug MSVC No Checks</Configuration>
<Platform>Win32</Platform>
@ -128,6 +136,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@ -194,6 +208,12 @@
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@ -298,6 +318,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -331,6 +354,9 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -385,6 +411,11 @@
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<IntDir>\$(IntDir)</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">
<LinkIncremental>true</LinkIncremental>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<IntDir>\$(IntDir)</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">
<LinkIncremental>true</LinkIncremental>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
@ -439,6 +470,10 @@
<LinkIncremental>true</LinkIncremental>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">
<LinkIncremental>true</LinkIncremental>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">
<LinkIncremental>true</LinkIncremental>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
@ -525,6 +560,27 @@
<Command>$(OutDir)\etl.exe</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_DISABLE_STRING_TRUNCATION_CHECKS;ETL_DISABLE_STRING_CLEAR_AFTER_USE;ETL_STRING_SIZE_SMALL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../unittest-cpp/;../../include;../../test</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>$(OutDir)\etl.exe</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">
<ClCompile>
<PrecompiledHeader>
@ -789,6 +845,27 @@
<Command>$(OutDir)\etl.exe</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../unittest-cpp/UnitTest++/;../../include/etl;../../test</AdditionalIncludeDirectories>
<UndefinePreprocessorDefinitions>
</UndefinePreprocessorDefinitions>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<LanguageStandard>stdcpp14</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>$(OutDir)\etl.exe</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">
<ClCompile>
<PrecompiledHeader>
@ -1463,6 +1540,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1475,6 +1553,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1506,6 +1585,7 @@
</ClCompile>
<ClCompile Include="..\test_flat_set.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1518,6 +1598,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1544,6 +1625,7 @@
<ClCompile Include="..\test_integral_limits.cpp" />
<ClCompile Include="..\test_intrusive_forward_list.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1556,6 +1638,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1572,6 +1655,7 @@
</ClCompile>
<ClCompile Include="..\test_intrusive_links.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1584,6 +1668,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1600,6 +1685,7 @@
</ClCompile>
<ClCompile Include="..\test_intrusive_list.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1612,6 +1698,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1628,6 +1715,7 @@
</ClCompile>
<ClCompile Include="..\test_intrusive_queue.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1640,6 +1728,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1656,6 +1745,7 @@
</ClCompile>
<ClCompile Include="..\test_intrusive_stack.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1668,6 +1758,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1689,6 +1780,7 @@
<ClCompile Include="..\test_list.cpp" />
<ClCompile Include="..\test_flat_map.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1701,6 +1793,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1721,6 +1814,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1733,6 +1827,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>
@ -1758,6 +1853,7 @@
<ClCompile Include="..\test_numeric.cpp" />
<ClCompile Include="..\test_observer.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|Win32'">false</ExcludedFromBuild>
@ -1770,6 +1866,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugLLVMNoSTL|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Clang|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugMSVCSmallStrings|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='MSVCDebugAppveyor|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='LLVM New|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug MSVC No Checks|x64'">false</ExcludedFromBuild>