summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_String.cxx18
-rw-r--r--src/Fl_Text_Display.cxx2
2 files changed, 13 insertions, 7 deletions
diff --git a/src/Fl_String.cxx b/src/Fl_String.cxx
index 7c82b0ec1..e07f23a94 100644
--- a/src/Fl_String.cxx
+++ b/src/Fl_String.cxx
@@ -23,15 +23,18 @@
Basic Fl_String class for FLTK.
*/
+/** Constructs an empty string */
Fl_String::Fl_String() {
init();
}
+/** Constructor from a C-style string */
Fl_String::Fl_String(const char *str) {
init();
value(str);
}
+/** Constructor from a buffer of \c size bytes */
Fl_String::Fl_String(const char *str, int size) {
init();
value(str, size);
@@ -43,13 +46,13 @@ void Fl_String::init() {
capacity_ = 0;
}
-// copy constructor
+/** copy constructor */
Fl_String::Fl_String(const Fl_String &in) {
init();
value(in.value(), in.size());
}
-// copy assignment operator
+/** copy assignment operator */
Fl_String& Fl_String::operator=(const Fl_String &in) {
if (this == &in)
return *this;
@@ -58,13 +61,14 @@ Fl_String& Fl_String::operator=(const Fl_String &in) {
return *this;
}
-// assignment operator for 'const char *'
+/** assignment operator for 'const char *' */
Fl_String& Fl_String::operator=(const char *in) {
value(in);
// debug("*STRING* assigned");
return *this;
}
+/** Destructor */
Fl_String::~Fl_String() {
delete[] value_;
}
@@ -96,15 +100,18 @@ void Fl_String::alloc_buf(int size, bool preserve_text) {
value_ = new_value;
}
+/** Assigns the string value to a C-style string */
void Fl_String::value(const char *str) {
value(str, str ? (int)strlen(str) : 0);
}
+/** Returns the number of non-null bytes in the object */
int Fl_String::slen() const {
if (!value_) return 0;
return (int)strlen(value_);
}
+/** Assigns the string value to a buffer of \c len bytes */
void Fl_String::value(const char *str, int len) {
if (str) {
alloc_buf(len);
@@ -119,12 +126,13 @@ void Fl_String::value(const char *str, int len) {
}
}
+/** Returns the minimum capacity of the object */
int Fl_String::capacity() const {
return capacity_; // > 0 ? capacity_ - 1 : capacity_;
}
-/** Set the minumum capacity to num_bytes plus one for a terminating NUL.
- The cintents of the string buffer will be copied if needed.
+/** Set the minimum capacity to \c num_bytes plus one for a terminating NUL.
+ The contents of the string buffer will be copied if needed.
\param num_bytes minimum size of buffer
*/
void Fl_String::capacity(int num_bytes) {
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index a7706acca..759cf6101 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1233,8 +1233,6 @@ int Fl_Text_Display::wrapped_row(int row) const {
(scroll_() counts them too) and/or to count from the most efficient
starting point, but the efficiency of this routine is not as important to
the overall performance of the text display.
-
- \todo Unicode?
*/
void Fl_Text_Display::display_insert() {
int hOffset, topLine, X, Y;