istring Class Reference

Provides a dynamically resizable character string. More...

#include <istring.h>

Inheritance diagram for istring:

Inheritance graph
[legend]
Collaboration diagram for istring:

Collaboration graph
[legend]
List of all members.

Public Types

enum  special_flag { UNTERMINATED = 62, SPRINTF = 84 }
enum  how_to_strip { FROM_FRONT = 1, FROM_END = 2, FROM_BOTH_SIDES = 3 }

Public Member Functions

 istring ()
 constructs an empty string.
 istring (const char *initial)
 constructs a copy of the string passed in "initial".
 istring (char c, int repeat)
 constructs a string with "repeat" characters of "c" in it.
 istring (const istring &s)
 Constructs a copy of the string "s".
 istring (special_flag way, const char *s,...)
 constructor that sports a few variable parameter constructions.
 ~istring ()
 destroys any storage for the string.
int length () const
 Returns the current length of the string.
int end () const
 returns the index of the last (non-null) character in the string.
bool empty () const
 empty() reports if the string is empty, that is, of zero length().
bool non_empty () const
 non_empty() reports if the string has some contents.
bool operator! () const
 the negation operator also returns true if the string is empty.
bool t () const
 t() is a shortcut for the string being "true", as in non-empty.
const char * observe () const
 observes the underlying pointer to the zero-terminated string.
const char * c_str () const
 synonym for observe. mimics the STL method name.
const char * s () const
 synonym for observe. the 's' stands for "string", if that helps.
char get (int index) const
 a constant peek at the string's internals at the specified index.
char * access ()
 provides access to the actual string held.
char * c_str ()
 synonym for access. mimics the STL method.
char * s ()
 synonym for access.
char & operator[] (int position)
 accesses individual characters in "this" string.
const char & operator[] (int position) const
 observes individual characters in "this" string.
void put (int position, char to_put)
 stores the character "to_put" at index "position" in the string.
istringsprintf (const char *s,...)
 similar to the SPRINTF constructor, but works on an existing string.
int convert (int default_value) const
 Converts the string into a corresponding integer.
long convert (long default_value) const
 converts the string to a long integer.
float convert (float default_value) const
 converts the string to a floating point number.
double convert (double default_value) const
 converts the string to a double precision floating point number.
bool operator< (const istring &that) const
 Returns true if this string is lexically less than the string "that".
bool operator> (const istring &that) const
 Returns true if this is lexically greater than the string "that".
bool operator<= (const istring &that) const
 Returns true if this is lexically less than or equal to "that".
bool operator>= (const istring &that) const
 Returns true if this is lexically greater than or equal to "that".
bool operator!= (const istring &that) const
 Returns true if this string is not equal to the string "that".
bool operator== (const istring &that) const
 Returns true if this string is equal to the string "that".
bool operator== (const char *that) const
 returns true if "that" is equal to this.
bool operator!= (const char *that) const
 returns true if "that" is not equal to this.
bool iequals (const istring &that) const
 returns true if this is case-insensitively equal to "that".
bool iequals (const char *that) const
 returns true if this is case-insensitively equal to "that".
bool compare (const istring &to_compare, int start_first, int start_second, int count) const
 Compares "this" string with "to_compare".
bool oy_icompare (const istring &to_compare, int start_first, int start_second, int count) const
 the case insensitive version of compare().
bool begins (const istring &maybe_prefix) const
 Returns true if "this" string begins with "maybe_prefix".
bool operator *= (const istring &maybe_prefix) const
 An alias for begins().
bool ibegins (const istring &maybe_prefix) const
 a case-insensitive method similar to begins().
bool ends (const istring &maybe_suffix) const
 returns true if this string ends with "maybe_suffix". a case-insensitive method similar to ends().
bool iends (const istring &maybe_suffix) const
istringoperator= (const istring &s)
 Sets the contents of this string to "s".
istringoperator= (const char *s)
 Sets the contents of this string to "s".
void reset ()
 clears out the contents string.
void reset (special_flag way, const char *s,...)
 operates like the constructor that takes a 'special_flag'.
void copy (char *to_stuff, int count) const
 Copies a maximum of "count" characters from this into "to_stuff".
void stuff (char *to_stuff, int count) const
 a synonym for copy().
istring operator+ (const istring &s) const
 Returns the concatenation of "this" and "s".
istringoperator+= (const istring &s)
 Modifies "this" by concatenating "s" onto it.
istringoperator+= (const char *s)
istring operator+ (const char *s) const
 < synonym for the concatenation operator but uses a char pointer instead. synonym for the concatenation operator but uses a char pointer instead.
istringoperator+= (char c)
 concatenater for single characters.
int find (char to_find, int position=0, bool reverse=false) const
 Locates "to_find" in "this".
int find (const istring &to_find, int posn=0, bool reverse=false) const
 finds "to_find" in this string.
int ifind (char to_find, int position=0, bool reverse=false) const
 like the find() methods above, but case-insensitive.
int ifind (const istring &to_find, int posn=0, bool reverse=false) const
 like the find() methods above, but case-insensitive.
int find_any (const istring &to_find, int position=0, bool reverse=false) const
 searches for any of the characters in "to_find".
int ifind_any (const istring &to_find, int position=0, bool reverse=false) const
 searches case-insensitively for any of the characters in "to_find".
int find_non_match (const istring &to_find, int position=0, bool reverse=false) const
 searches for any character that is not in "to_find" and returns index.
bool contains (const istring &to_find) const
 Returns true if "to_find" is contained in this string or false if not.
bool operator^= (const istring &to_find) const
 An alias for contains().
istring substring (int start, int end) const
 Returns the segment of "this" between the indices "start" and "end".
void substring (istring &target, int start, int end) const
 a version that stores the substring in an existing "target" string.
void pad (int length, char padding= ' ')
 makes the string "length" characters long.
void trim (int length)
 shortens the string to "length" if it's longer than that.
void insert (int position, const istring &to_insert)
 Copies "to_insert" into "this" at the "position".
void zap (int start, int end)
 Deletes the characters between "start" and "end" inclusively.
void to_lower ()
 to_lower modifies "this" by replacing capitals with lower-case.
void to_upper ()
 to_upper does the opposite of to_lower (that is, q becomes Q).
istring lower () const
 like to_lower(), but returns a new string rather than modifying this.
istring upper () const
 like to_upper(), but returns a new string rather than modifying this.
bool replace (const istring &tag, const istring &replacement)
 replaces the first occurrence of "tag" text with the "replacement".
bool replace_all (char to_replace, char new_char)
 changes all occurrences of "to_replace" with "new_char".
bool replace_all (const istring &to_replace, const istring &new_string)
void shrink ()
 changes all occurrences of "to_replace" into "new_string". resizes the string to its minimum possible length.
void strip (const istring &strip_list, how_to_strip way=FROM_BOTH_SIDES)
 strips all chars from "strip_list" out of "this" given the "way".
void strip_spaces (how_to_strip way=FROM_BOTH_SIDES)
 removes excess space characters from string's beginning, end or both.
void strip_white_spaces (how_to_strip way=FROM_BOTH_SIDES)
 like strip_spaces, but includes tabs in the list to strip.
void pack (byte_array &target) const
 stores this string in the "target". it can later be unpacked again.
bool unpack (byte_array &source)
 retrieves a string (packed with pack()) from "source" into this string.
int icompare (const istring &to_compare, int length=-1) const
 provides a case insensitive comparison routine.
int icompare (const char *to_compare, int length=-1) const
 a version of the above for raw character pointers.
const byte_sequencelow_level () const
 provides access to the low-level implementation of the object.
istringbase_sprintf (const char *s, va_list &args)
byte_sequenceget_implem ()

Static Public Member Functions

static const istringempty_string ()
 useful wherever empty strings are needed, e.g., function defaults.
static bool matches (const istring &match_list, char to_match)
 returns true if "to_match" is found in the "match_list" string.
static int slow_strncasecmp (const char *first, const char *second, int length=-1)
 a replacement for strncasecmp on platforms without them.

Detailed Description

Provides a dynamically resizable character string.

It mimics the standard (char *) type, but provides a slew of helpful methods as well as enforcing bounds checking on the underlying array.

Definition at line 28 of file istring.h.


Member Enumeration Documentation

enum istring::special_flag

Enumerator:
UNTERMINATED 
SPRINTF 

Definition at line 45 of file istring.h.

enum istring::how_to_strip

Enumerator:
FROM_FRONT 
FROM_END 
FROM_BOTH_SIDES 

Definition at line 324 of file istring.h.


Constructor & Destructor Documentation

istring::istring (  ) 

constructs an empty string.

Definition at line 68 of file istring.cpp.

Referenced by istring(), pad(), and reset().

istring::istring ( const char *  initial  ) 

constructs a copy of the string passed in "initial".

Definition at line 93 of file istring.cpp.

References access(), FUNCDEF, array< contents >::internal_offset_mem(), and array< contents >::put().

istring::istring ( char  c,
int  repeat 
)

constructs a string with "repeat" characters of "c" in it.

if "c" is the null character (i.e., equal to zero), then the resulting string will have "repeat" space characters in it.

Definition at line 73 of file istring.cpp.

References array< contents >::access(), FUNCDEF, array< contents >::internal_offset_mem(), non_positive(), and array< contents >::put().

istring::istring ( const istring s  ) 

Constructs a copy of the string "s".

Definition at line 87 of file istring.cpp.

istring::istring ( special_flag  way,
const char *  s,
  ... 
)

constructor that sports a few variable parameter constructions.

For a flag of "UNTERMINATED", the constructor expects the third parameter to be an integer, and then it copies that number of characters from the C-string "s" without assuming that "s" is zero terminated.

For a flag of "SPRINTF", a string is constructed using the format specifier in "s" in a manner similar to the "sprintf()" function (see the standard library for <string.h>). If there are no "%" codes in "s", then the constructor just copies "s" without modification. If "%" codes are in the character array, then any additional arguments (...) are interpreted as they would be by sprintf(). The length of the constructed string is tailored to fit the actual contents. If "s" is null, then the resulting string will be empty. Currently, the "*" specifier for variable length fields is not supported.

Definition at line 106 of file istring.cpp.

References base_sprintf(), FUNCDEF, istring(), length(), operator=(), array< contents >::reset(), SPRINTF, and UNTERMINATED.

istring::~istring (  ) 

destroys any storage for the string.

Definition at line 134 of file istring.cpp.

References NIL, and WHACK().


Member Function Documentation

int istring::length (  )  const

Returns the current length of the string.

The length returned does not include the terminating null character at the end of the string.

Definition at line 140 of file istring.cpp.

References array< contents >::length().

Referenced by ADD(), ini_parser::add(), file_differ::AddCRs(), portable::break_line(), byte_format::bytes_to_shifted_string(), filename::canonicalize(), string_manipulation::carriage_returns_to_spaces(), cromp_common::chew_hostname(), xml_generator::clean_reserved_mod(), command_line::command_line(), compare(), directory_tree::compare_trees(), service_control::control_service(), convert(), subnet_calculator::convert(), copy(), creatapose(), crop_non_numeric(), crop_numeric(), cromp_common::decode_host(), network_address::detokenize(), filename::detooth_filename(), filename::drive(), list_parsing::emit_quoted_chunk(), secret_string::encrypt_string(), end(), string_manipulation::escape_chars(), filename::exists(), filename::extension(), FIND(), command_line::find(), portable::get_cmdline_from_proc(), command_line::get_command_line(), list_parsing::get_ids_from_string(), list_parsing::get_rest_of_line(), ini_configurator::get_section(), list_parsing::get_separated_value(), command_line::get_value(), list_parsing::get_values_from_string(), version_checker::get_version(), internet_address::has_ip_address(), istring_hasher::hash(), icompare(), imatches_any(), info_edit::info_edit(), insert(), internet_machine_uid::internet_machine_uid(), internet_address::ip_appropriate_number(), tokenizer::is_eol_a_separator(), istring(), process_manager::launch_now(), application_shell::log(), file_logger::log(), debugging_base::log(), main(), octopus_entity::mangled_form(), matches(), matches_any(), matches_none(), common_database_support::nerf_special_characters(), debugging_console_view::OnBeginPrinting(), operator *=(), operator+=(), oy_icompare(), file_transfer_header::packed_size(), octopus_entity::packed_size(), string_table::packed_size(), string_set::packed_size(), pad(), list_parsing::parse_csv_line(), byte_format::parse_dump(), ini_configurator::put(), table_configurator::put(), ini_configurator::put_section(), service_control::reconfigure_service(), replace_all(), database_login_info::replace_value(), reset(), run_test_01(), run_test_03(), run_test_04(), run_test_09(), run_test_10(), run_test_11(), run_test_12(), run_test_14(), run_test_16(), run_test_18(), run_test_25(), run_test_31(), run_test_32(), run_test_41(), SAFE_STATIC_CONST(), smtp_client::send_email(), filename::separate(), command_line::separate_command_line(), smtp_client::set_body(), smtp_client::set_subject(), byte_format::shifted_string_to_bytes(), show_message(), post_office::show_routes(), string_manipulation::split_lines(), strain_out_html_codes(), string_manipulation::string_to_hex(), strip(), parser_bits::substitute_env_vars(), string_manipulation::substring(), test_bogon_amorph(), test_byte_array_amorph(), test_stack_with_objects(), test_stack_with_pointers(), directory_tree::text_form(), octopus_entity::text_form(), to_lower(), to_upper(), trim(), string_manipulation::unescape_chars(), database_login_info::update_freetds_configuration(), query_handler::use_database(), smtp_client::validate_address(), version::version(), stdio_redirecter::write(), byte_filer::write(), version_ini::write_code(), and version_ini::write_rc().

int istring::end (  )  const [inline]

returns the index of the last (non-null) character in the string.

If there is no content in the string, then a negative value is returned.

Definition at line 72 of file istring.h.

References length().

Referenced by portable::break_line(), bookmark_tree::break_name(), filename::canonicalize(), compare(), nechung_oracle::display_random(), write_build_config::execute(), filename::extension(), filename::filename(), octopus_request_id::from_text(), info_edit::info_edit(), portable::launch_process(), main(), operator[](), oy_icompare(), tokenizer::parse(), grid_processor::process_grid_files(), bookmark_tree::process_link(), smtp_client::prune_address(), bookmark_tree::read_csv_file(), directory::recursive_create(), replace(), filename::rootname(), run_test_21(), run_test_32(), ini_configurator::sections(), command_line::separate_command_line(), strip(), substring(), portable::system_error_text(), tokenizer::text_form(), parser_bits::translate_CR_for_platform(), trim(), version::version(), version_ini::write_assembly(), critical_events::write_to_critical_events(), and zap().

bool istring::empty (  )  const [inline]

empty() reports if the string is empty, that is, of zero length().

Definition at line 76 of file istring.h.

Referenced by octopus_entity::blank(), and t().

bool istring::non_empty (  )  const [inline]

non_empty() reports if the string has some contents.

Definition at line 78 of file istring.h.

bool istring::operator! (  )  const [inline]

the negation operator also returns true if the string is empty.

it can be used in expressions in a readable way, for example: if (!my_string) { it_is_empty; }

Definition at line 80 of file istring.h.

bool istring::t (  )  const [inline]

t() is a shortcut for the string being "true", as in non-empty.

the logic here is that the string is not false because it's not empty. for example: if (my_string.t()) { it_is_not_empty; }

Definition at line 83 of file istring.h.

References empty().

Referenced by listo_links::add(), file_info::calculate(), filename_list::calculate_progress(), combine(), command_line::command_line(), directory_tree::compare_trees(), subnet_calculator::convert(), recursive_file_copy::copy_hierarchy(), debugger::create_debug_message(), version_checker::get_handle(), timer_driver::handle_system_timer(), service_root::install(), version_checker::loaded(), bookmark_tree::magic_category_comparison(), wx_debugging_base::name(), debugging_base::name(), internet_address::normalize_host(), debugging_console_view::OnBeginPrinting(), tiny_shell::OnCreate(), version_ini::one_stop_version_stamp(), byte_filer::open(), tokenizer::parse(), bookmark_tree::process_comment(), grid_processor::process_grid_files(), version_checker::retrieve_version_info(), section_manager::section_exists(), smtp_client::send_email(), version::set_component(), wx_debugging_base::setup(), debugging_base::setup(), post_office::show_mail(), parser_bits::substitute_env_vars(), test_string_table(), file_info::text_form(), database_login_info::update_freetds_configuration(), and version_ini::write_assembly().

const istring & istring::empty_string (  )  [static]

useful wherever empty strings are needed, e.g., function defaults.

note that this is implemented in the opsystem library to avoid bad issues with static objects mixed into multiple dlls from a static library.

Definition at line 136 of file istring.cpp.

References __istring_empty_string().

Referenced by bookmark_tree::break_name(), filename::compare_prefix(), filename::compare_suffix(), directory_tree::compare_trees(), list_parsing::create_csv_line(), directory_tree::current(), directory_tree::current_dir(), tcpip_stack::fill_and_resolve(), locked_logger::get_ending(), library_wide_cleanup::library_wide_cleanup(), list_parsing::parse_csv_line(), bookmark_tree::process_comment(), database_login_info::reset(), run_test_01(), filename::separate(), and heartbeat::text_form().

const char * istring::observe (  )  const

observes the underlying pointer to the zero-terminated string.

this does not allow the contents to be modified. this method should never return NIL.

Definition at line 148 of file istring.cpp.

References array< contents >::observe().

Referenced by compare(), hoople_api::string_conversions::convert(), convert(), copy(), directory::directory(), tcpip_stack::dns_resolve(), portable::env_string(), filename::exists(), tcpip_stack::full_resolve(), path_configuration::get_logging_directory(), ini_configurator::get_section(), istring_hasher::hash(), icompare(), iequals(), internet_machine_uid::internet_machine_uid(), parser_bits::is_alphanumeric(), parser_bits::is_hexadecimal(), parser_bits::is_identifier(), parser_bits::is_numeric(), main(), octopus_entity::mangled_form(), operator!=(), directory::operator=(), operator==(), oy_icompare(), nechung_oracle::pick_random(), byte_filer::read(), shrink(), substring(), test_byte_array_amorph(), linked_buffer::text_form(), buffer::text_form(), unix_rendez_file(), stdio_redirecter::write(), and byte_filer::write().

const char* istring::c_str (  )  const [inline]

synonym for observe. mimics the STL method name.

Definition at line 97 of file istring.h.

const char* istring::s (  )  const [inline]

synonym for observe. the 's' stands for "string", if that helps.

Definition at line 99 of file istring.h.

Referenced by directory::absolute_path(), ADD(), argument_list::add(), application_config::add_program(), guards::alert_message(), octopus_entity::breakout(), byte_format::bytes_to_string(), CHECK_STACK_RESULT(), cromp_common::chew_hostname(), filename::chmod(), version_checker::complain_cannot_load(), version_checker::complain_wrong_version(), creatapose(), drawing_window::Create(), file_differ::diff_files(), menu::draw(), secret_string::encrypt_string(), file_time::file_time(), FIND(), guards::FL_continuable_error(), guards::FL_deadly_error(), guards::FL_non_continuable_error(), formal(), bit_vector::get(), portable::get_cmdline_from_proc(), path_configuration::get_logging_directory(), version_checker::good_version(), header_string(), service_root::initialize(), service_root::install(), internet_address::is_valid_internet_address(), portable::launch_process(), list_box::list_box_callback(), library_plugins::dynamic_library_loader::load_the_library(), file_logger::log(), console_logger::log(), query_handler::login_to_database(), main(), directory::make_directory(), transition_map::make_transition(), octopus_entity::mangled_form(), byte_filer::open(), parse_address(), cromp_transaction::peek_header(), nechung_oracle::pick_random(), query_handler::process_query(), grid_processor::process_query_as_df(), transition_map::pulse(), socket_minder::push_receives(), socket_minder::push_sends(), directory::remove_directory(), rendezvous::rendezvous(), directory::rescan(), file_time::reset(), run_test_01(), run_test_04(), run_test_05(), run_test_10(), run_test_12(), run_test_14(), run_test_24(), run_test_30(), run_test_34(), raw_socket::select(), smtp_client::send_email(), smtp_client::set_body(), portable::set_environ(), smtp_client::set_subject(), zing_table::show_events(), slider::slider(), standard_sprintf_test(), byte_format::string_to_bytes(), system_string::system_string(), test_bogon_amorph(), test_byte_array_amorph(), test_string_table(), process_entry::text_form(), octopus_entity::text_form(), nodes::symbol_tree::text_form(), geometric::point< numeric_type >::text_form(), memory_limiter::text_form(), spocket::text_form(), socket_data::text_form(), connection::text_form(), transition_map::time_slice(), file_logger::truncate(), filename::unlink(), query_handler::use_database(), version_ini::write_code(), version_ini::write_rc(), and critical_events::write_to_critical_events().

char istring::get ( int  index  )  const

a constant peek at the string's internals at the specified index.

Definition at line 146 of file istring.cpp.

References array< contents >::get().

Referenced by filename::canonicalize(), command_line::command_line(), filename::dirname(), filename::drive(), tokenizer::is_eol_a_separator(), matches(), replace_all(), string_manipulation::string_to_hex(), strip(), tokenizer::text_form(), to_lower(), and to_upper().

char * istring::access (  ) 

provides access to the actual string held.

this should never return NIL. be very careful with the returned pointer: don't destroy or corrupt its contents (e.g., do not mess with its zero termination).

Definition at line 144 of file istring.cpp.

References array< contents >::access().

Referenced by c_str(), byte_filer::getline(), istring(), main(), and test_byte_array_amorph().

char* istring::c_str (  )  [inline]

synonym for access. mimics the STL method.

Definition at line 110 of file istring.h.

References access().

char* istring::s (  )  [inline]

synonym for access.

Definition at line 112 of file istring.h.

char & istring::operator[] ( int  position  ) 

accesses individual characters in "this" string.

if the "position" is out of range, the return value is not meaningful.

Definition at line 752 of file istring.cpp.

References end(), and array< contents >::use().

const char & istring::operator[] ( int  position  )  const

observes individual characters in "this" string.

if the "position" is out of range, the return value is not meaningful.

Definition at line 761 of file istring.cpp.

References end(), and array< contents >::get().

void istring::put ( int  position,
char  to_put 
) [inline]

stores the character "to_put" at index "position" in the string.

Definition at line 124 of file istring.h.

Referenced by filename::canonicalize(), and replace_all().

istring & istring::sprintf ( const char *  s,
  ... 
)

similar to the SPRINTF constructor, but works on an existing string.

any existing contents in the string are wiped out.

Definition at line 187 of file istring.cpp.

References base_sprintf().

Referenced by istring_sprintf_test().

int istring::convert ( int  default_value  )  const

Converts the string into a corresponding integer.

The conversion starts at index 0 in "this" string, and stores it in "value". If a valid integer was found, it is returned. otherwise, the "default_value" is returned. NOTE: be careful of implicit conversions here; the "default_value" for any of these functions must either be an object of the exact type needed or must be cast to that type.

Definition at line 770 of file istring.cpp.

References length(), and observe().

Referenced by subnet_calculator::convert(), application_config::find_program(), geometric::rectangle< numeric_type >::from_text(), geometric::point< numeric_type >::from_text(), internet_address::ip_appropriate_number(), configurator::load(), main(), application_config::parse_startup_entry(), grid_processor::process_grid_files(), and run_test_15().

long istring::convert ( long  default_value  )  const

converts the string to a long integer.

Definition at line 779 of file istring.cpp.

References length(), and observe().

float istring::convert ( float  default_value  )  const

converts the string to a floating point number.

Definition at line 788 of file istring.cpp.

References length(), and observe().

double istring::convert ( double  default_value  )  const

converts the string to a double precision floating point number.

Definition at line 797 of file istring.cpp.

References length(), and observe().

bool istring::operator< ( const istring that  )  const

Returns true if this string is lexically less than the string "that".

Definition at line 151 of file istring.cpp.

References _implementation.

bool istring::operator> ( const istring that  )  const

Returns true if this is lexically greater than the string "that".

Definition at line 154 of file istring.cpp.

References _implementation.

bool istring::operator<= ( const istring that  )  const

Returns true if this is lexically less than or equal to "that".

Definition at line 157 of file istring.cpp.

References _implementation.

bool istring::operator>= ( const istring that  )  const

Returns true if this is lexically greater than or equal to "that".

Definition at line 160 of file istring.cpp.

References _implementation.

bool istring::operator!= ( const istring that  )  const

Returns true if this string is not equal to the string "that".

Definition at line 163 of file istring.cpp.

bool istring::operator== ( const istring that  )  const

Returns true if this string is equal to the string "that".

Definition at line 166 of file istring.cpp.

References observe().

bool istring::operator== ( const char *  that  )  const

returns true if "that" is equal to this.

Definition at line 169 of file istring.cpp.

References observe().

bool istring::operator!= ( const char *  that  )  const

returns true if "that" is not equal to this.

Definition at line 172 of file istring.cpp.

References observe().

bool istring::iequals ( const istring that  )  const

returns true if this is case-insensitively equal to "that".

Definition at line 578 of file istring.cpp.

References observe().

Referenced by case_insense_compare(), tcpip_stack::dns_resolve(), tcpip_stack::fill_and_resolve(), filename_list::find(), command_line::find(), application_config::find_program(), tcpip_stack::full_resolve(), service_root::install(), filename_list::locate(), bookmark_tree::magic_category_comparison(), filename_list::member(), grid_processor::reset_data_fields(), and grid_processor::write_fields_for_row().

bool istring::iequals ( const char *  that  )  const

returns true if this is case-insensitively equal to "that".

Definition at line 581 of file istring.cpp.

References observe().

bool istring::compare ( const istring to_compare,
int  start_first,
int  start_second,
int  count 
) const

Compares "this" string with "to_compare".

The "start_first" is where the comparison begins in "this" string, and "start_second" where it begins in the "to_compare". The "count" is the number of characters to compare between the two strings. If either index is out of range, or "count"-1 + either index is out of range, then compare returns false. If the strings differ in that range, false is returned. Only if the strings have identical contents in the range is true returned.

Definition at line 824 of file istring.cpp.

References bounds_return, end(), length(), and observe().

Referenced by write_build_config::check_nesting(), write_build_config::execute(), process_control::find_process_in_list(), operator *=(), and run_test_10().

bool istring::oy_icompare ( const istring to_compare,
int  start_first,
int  start_second,
int  count 
) const

the case insensitive version of compare().

Definition at line 857 of file istring.cpp.

References bounds_return, end(), length(), and observe().

bool istring::begins ( const istring maybe_prefix  )  const [inline]

Returns true if "this" string begins with "maybe_prefix".

Definition at line 183 of file istring.h.

Referenced by ibegins(), string_table::is_comment(), main(), and run_test_34().

bool istring::operator *= ( const istring maybe_prefix  )  const [inline]

An alias for begins().

Definition at line 186 of file istring.h.

References compare(), and length().

bool istring::ibegins ( const istring maybe_prefix  )  const [inline]

a case-insensitive method similar to begins().

Definition at line 190 of file istring.h.

References begins().

Referenced by run_test_34().

bool istring::ends ( const istring maybe_suffix  ) <