[DEV] add back in the string API
This commit is contained in:
parent
b1c561b0ab
commit
a739c5d808
@ -1,4 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* @author Edouard DUPIN
|
||||||
|
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||||
|
* @license MPL-2 (see license file)
|
||||||
|
*/
|
||||||
|
|
||||||
#include <etk/String.hpp>
|
#include <etk/String.hpp>
|
||||||
#include <etk/UString.hpp>
|
#include <etk/UString.hpp>
|
||||||
@ -256,6 +260,14 @@ void etk::String::popBack() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char& etk::String::back() {
|
||||||
|
return m_data[m_data.size()-2];
|
||||||
|
}
|
||||||
|
|
||||||
|
const char& etk::String::back() const {
|
||||||
|
return m_data[m_data.size()-2];
|
||||||
|
}
|
||||||
|
|
||||||
void etk::String::reserve(size_t _size) {
|
void etk::String::reserve(size_t _size) {
|
||||||
m_data.reserve(_size+1);
|
m_data.reserve(_size+1);
|
||||||
}
|
}
|
||||||
|
@ -362,6 +362,12 @@ namespace etk {
|
|||||||
* @brief Remove the last element of the string
|
* @brief Remove the last element of the string
|
||||||
*/
|
*/
|
||||||
void popBack();
|
void popBack();
|
||||||
|
/**
|
||||||
|
* @brief Get the last element of the String
|
||||||
|
* @return An reference on the last char
|
||||||
|
*/
|
||||||
|
char& back();
|
||||||
|
const char& back() const;
|
||||||
/**
|
/**
|
||||||
* @brief Force the container to have a minimum size in memory allocation
|
* @brief Force the container to have a minimum size in memory allocation
|
||||||
* @param[in] _size Size in byte that is requested.
|
* @param[in] _size Size in byte that is requested.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user