Browse Source

Added 'capture' virtual function to 'String_Type'; implemented 'capture' function in 'Shift_String'.

release/0.19
Jessica James 9 years ago
parent
commit
72a1b6c758
  1. 9
      Jupiter/Shift_String.h
  2. 10
      Jupiter/Shift_String_Imp.h
  3. 9
      Jupiter/String_Type.h
  4. BIN
      Release/Jupiter.lib

9
Jupiter/Shift_String.h

@ -82,6 +82,15 @@ namespace Jupiter
*/
virtual void erase();
/**
* @brief Captures an input string of elements and uses it as the internal string.
* Note: Do NOT externally delete[] or free() 'in'.
*
* @param in Pointer to the start of the string to capture
* @param in_length Number of elements in the string
*/
virtual void capture(T *in, size_t in_length);
/**
* @brief Sets the internal buffer to be at least large enough to old a specified number of elements.
* Note: This does nothing if len is less than the string's current length.

10
Jupiter/Shift_String_Imp.h

@ -79,6 +79,16 @@ template<typename T> void Jupiter::Shift_String_Type<T>::erase()
Jupiter::String_Type<T>::str = Jupiter::Shift_String_Type<T>::base;
}
// capture
template<typename T> void Jupiter::Shift_String_Type<T>::capture(T *in, size_t in_size)
{
delete[] Jupiter::Shift_String_Type<T>::base;
Jupiter::Shift_String_Type<T>::base = in;
Jupiter::String_Type<T>::length = in_size;
}
template<typename T> bool Jupiter::Shift_String_Type<T>::setBufferSize(size_t len)
{
if (len > Jupiter::String_Type<T>::length)

9
Jupiter/String_Type.h

@ -137,6 +137,15 @@ namespace Jupiter
*/
virtual void processEscapeSequences();
/**
* @brief Captures an input string of elements and uses it as the internal string.
* Note: Do NOT externally delete[] or free() 'in'.
*
* @param in Pointer to the start of the string to capture
* @param in_length Number of elements in the string
*/
virtual void capture(T *in, size_t in_length) = 0;
/**
* @brief Sets the value of an element at the specified index.
* Note: If the index is not in the string, it will be added.

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save