Browse Source

Added isEmpty() to Readable_String.

release/0.19
JustinAJ 11 years ago
parent
commit
500dae3683
  1. 13
      Jupiter/Readable_String.h
  2. 7
      Jupiter/Readable_String_Imp.h

13
Jupiter/Readable_String.h

@ -49,6 +49,13 @@ namespace Jupiter
*/ */
virtual const T &get(size_t index) const = 0; virtual const T &get(size_t index) const = 0;
/**
* @brief Returns a pointer to the underlying string of elements.
*
* @return Pointer to the underlying string of elements.
*/
virtual const T *ptr() const = 0;
/** /**
* @brief Returns the number of elements in the String. * @brief Returns the number of elements in the String.
* *
@ -57,11 +64,11 @@ namespace Jupiter
virtual size_t size() const = 0; virtual size_t size() const = 0;
/** /**
* @brief Returns a pointer to the underlying string of elements. * @brief Checks if the String is empty.
* *
* @return Pointer to the underlying string of elements. * @return True if the String is empty, false otherwise.
*/ */
virtual const T *ptr() const = 0; virtual bool isEmpty() const;
/** /**
* @brief Checks if the string contains an element with the specified value. * @brief Checks if the string contains an element with the specified value.

7
Jupiter/Readable_String_Imp.h

@ -32,6 +32,13 @@
* Readable_String * Readable_String
*/ */
// isEmpty
template<typename T> bool Jupiter::Readable_String<T>::isEmpty() const
{
return this->size() == 0;
}
// contains // contains
template<typename T> bool Jupiter::Readable_String<T>::contains(const T &value) const template<typename T> bool Jupiter::Readable_String<T>::contains(const T &value) const

Loading…
Cancel
Save