#include <BaseString.hpp>
Public Member Functions | |
| BaseString () | |
| Constructs an empty string. | |
| BaseString (const char *s) | |
| Constructs a copy of a char *. | |
| BaseString (const BaseString &str) | |
| Constructs a copy of another BaseString. | |
| ~BaseString () | |
| Destructor. | |
| const char * | c_str () const |
| Returns a C-style string. | |
| unsigned | length () const |
| Returns the length of the string. | |
| bool | empty () const |
| Checks if the string is empty. | |
| void | clear () |
| Clear a string. | |
| BaseString & | ndb_toupper () |
| Convert to uppercase. | |
| BaseString & | ndb_tolower () |
| Convert to lowercase. | |
| BaseString & | assign (const char *s) |
| Assigns from a char *. | |
| BaseString & | assign (const BaseString &str) |
| Assigns from another BaseString. | |
| BaseString & | assign (const char *s, size_t n) |
| Assigns from char *s, with maximum length n. | |
| BaseString & | assign (const BaseString &str, size_t n) |
| Assigns from another BaseString, with maximum length n. | |
| BaseString & | assign (const Vector< BaseString > &vector, const BaseString &separator=BaseString(" ")) |
| BaseString & | append (const char *s) |
| Appends a char * to the end. | |
| BaseString & | append (char c) |
| Appends a char to the end. | |
| BaseString & | append (const BaseString &str) |
| Appends another BaseString to the end. | |
| BaseString & | append (const Vector< BaseString > &vector, const BaseString &separator=BaseString(" ")) |
| BaseString & | assfmt (const char *ftm,...) |
| Assigns from a format string a la printf(). | |
| BaseString & | appfmt (const char *ftm,...) |
| Appends a format string a la printf() to the end. | |
| int | split (Vector< BaseString > &vector, const BaseString &separator=BaseString(" "), int maxSize=-1) const |
| ssize_t | indexOf (char c) |
| ssize_t | lastIndexOf (char c) |
| BaseString | substr (ssize_t start, ssize_t stop=-1) |
| BaseString & | operator= (const BaseString &str) |
| Assignment operator. | |
| bool | operator< (const BaseString &str) const |
| Compare two strings. | |
| bool | operator== (const BaseString &str) const |
| Are two strings equal? | |
| bool | operator== (const char *str) const |
| Are two strings equal? | |
| bool | operator!= (const BaseString &str) const |
| Are two strings not equal? | |
| bool | operator!= (const char *str) const |
| Are two strings not equal? | |
| BaseString & | trim (const char *delim=" \t") |
Static Public Member Functions | |
| static char ** | argify (const char *argv0, const char *src) |
| static char * | trim (char *src, const char *delim) |
| static int | snprintf (char *str, size_t size, const char *format,...) |
| static int | vsnprintf (char *str, size_t size, const char *format, va_list ap) |
Private Attributes | |
| char * | m_chr |
| unsigned | m_len |
Definition at line 27 of file BaseString.hpp.
| BaseString::BaseString | ( | ) |
| BaseString::BaseString | ( | const char * | s | ) |
| BaseString::BaseString | ( | const BaseString & | str | ) |
Constructs a copy of another BaseString.
Definition at line 37 of file BaseString.cpp.
References m_chr, m_len, memcpy, and n.
00038 { 00039 const char* const s = str.m_chr; 00040 const size_t n = str.m_len; 00041 char* t = new char[n + 1]; 00042 memcpy(t, s, n + 1); 00043 m_chr = t; 00044 m_len = n; 00045 }
| BaseString::~BaseString | ( | ) |
Destructor.
Definition at line 47 of file BaseString.cpp.
References m_chr.
00048 { 00049 delete[] m_chr; 00050 }
| BaseString & BaseString::append | ( | const Vector< BaseString > & | vector, | |
| const BaseString & | separator = BaseString(" ") | |||
| ) |
Appends a Vector of BaseStrings to the end, each Vector entry separated by separator.
| vector | Vector of BaseStrings to append | |
| separator | Separation between appended strings |
Definition at line 109 of file BaseString.cpp.
References append(), separator, and Vector< T >::size().
00110 { 00111 for(size_t i=0;i<vector.size(); i++) { 00112 append(vector[i]); 00113 if(i<vector.size()-1) 00114 append(separator); 00115 } 00116 return *this; 00117 }
Here is the call graph for this function:

| BaseString & BaseString::append | ( | const BaseString & | str | ) |
Appends another BaseString to the end.
Definition at line 103 of file BaseString.cpp.
References append(), and m_chr.
Here is the call graph for this function:

| BaseString & BaseString::append | ( | char | c | ) |
Appends a char to the end.
Definition at line 98 of file BaseString.cpp.
References appfmt().
00098 { 00099 return appfmt("%c", c); 00100 }
Here is the call graph for this function:

| BaseString & BaseString::append | ( | const char * | s | ) |
Appends a char * to the end.
Definition at line 85 of file BaseString.cpp.
References m_chr, m_len, memcpy, n, and strlen().
Referenced by MgmtSrvr::alloc_node_id(), ConfigRetriever::allocNodeId(), append(), appfmt(), assign(), check_node_vs_replicas(), ConfigRetriever::ConfigRetriever(), Qmgr::execCONTINUEB(), Ndbcntr::execCONTINUEB(), fixPortNumber(), ConfigRetriever::getConfig(), NdbTransaction::getNdbIndexOperation(), main(), LocalConfig::readFile(), reportShutdown(), and MgmtSrvr::start().
00086 { 00087 const size_t n = strlen(s); 00088 char* t = new char[m_len + n + 1]; 00089 memcpy(t, m_chr, m_len); 00090 memcpy(t + m_len, s, n + 1); 00091 delete[] m_chr; 00092 m_chr = t; 00093 m_len += n; 00094 return *this; 00095 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BaseString & BaseString::appfmt | ( | const char * | ftm, | |
| ... | ||||
| ) |
Appends a format string a la printf() to the end.
Definition at line 145 of file BaseString.cpp.
References append(), basestring_vsnprintf(), and buf.
Referenced by MgmtSrvr::alloc_node_id(), append(), LogHandler::append_impl(), check_node_vs_replicas(), Qmgr::execCONTINUEB(), Ndbcntr::execCONTINUEB(), Ndb_mgmclient::execute(), Configuration::fetch_configuration(), getRestartAction(), getTextNDBStopCompleted(), getTextNDBStopForced(), Ndb_mgmd_event_service::log(), Dblqh::logLqhkeyrefLab(), main(), ndb_mgm_listen_event_internal(), ndb_mgm_report_event(), ndb_mgm_restart3(), ndb_mgm_stop3(), MgmtSrvr::saveConfig(), and MgmApiSession::stop_session_if_not_connected().
00146 { 00147 char buf[1]; 00148 va_list ap; 00149 int l; 00150 00151 /* Figure out how long the formatted string will be. A small temporary 00152 * buffer is used, because I don't trust all implementations to work 00153 * when called as vsnprintf(NULL, 0, ...). 00154 */ 00155 va_start(ap, fmt); 00156 l = basestring_vsnprintf(buf, sizeof(buf), fmt, ap) + 1; 00157 va_end(ap); 00158 char *tmp = new char[l]; 00159 va_start(ap, fmt); 00160 basestring_vsnprintf(tmp, l, fmt, ap); 00161 va_end(ap); 00162 append(tmp); 00163 delete[] tmp; 00164 return *this; 00165 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char ** BaseString::argify | ( | const char * | argv0, | |
| const char * | src | |||
| ) | [static] |
Return c-array with strings suitable for execve When whitespace is detected, the characters '"' and '\' are honored, to make it possible to give arguments containing whitespace. The semantics of '"' and '\' match that of most Unix shells.
Definition at line 242 of file BaseString.cpp.
References iswhite, malloc, NULL, Vector< T >::push_back(), Vector< T >::size(), strdup(), and strlen().
Referenced by CPCD::Process::do_exec(), and setup_environment().
00242 { 00243 Vector<char *> vargv; 00244 00245 if(argv0 != NULL) 00246 vargv.push_back(strdup(argv0)); 00247 00248 char *tmp = new char[strlen(src)+1]; 00249 char *dst = tmp; 00250 const char *end = src + strlen(src); 00251 /* Copy characters from src to destination, while compacting them 00252 * so that all whitespace is compacted and replaced by a NUL-byte. 00253 * At the same time, add pointers to strings in the vargv vector. 00254 * When whitespace is detected, the characters '"' and '\' are honored, 00255 * to make it possible to give arguments containing whitespace. 00256 * The semantics of '"' and '\' match that of most Unix shells. 00257 */ 00258 while(src < end && *src) { 00259 /* Skip initial whitespace */ 00260 while(src < end && *src && iswhite(*src)) 00261 src++; 00262 00263 char *begin = dst; 00264 while(src < end && *src) { 00265 /* Handle '"' quotation */ 00266 if(*src == '"') { 00267 src++; 00268 while(src < end && *src && *src != '"') { 00269 if(*src == '\\') 00270 src++; 00271 *dst++ = *src++; 00272 } 00273 src++; 00274 if(src >= end) 00275 goto end; 00276 } 00277 00278 /* Handle '\' */ 00279 if(*src == '\\') 00280 src++; 00281 else if(iswhite(*src)) 00282 break; 00283 00284 /* Actually copy characters */ 00285 *dst++ = *src++; 00286 } 00287 00288 /* Make sure the string is properly terminated */ 00289 *dst++ = '\0'; 00290 src++; 00291 00292 vargv.push_back(strdup(begin)); 00293 } 00294 end: 00295 00296 delete[] tmp; 00297 vargv.push_back(NULL); 00298 00299 /* Convert the C++ Vector into a C-vector of strings, suitable for 00300 * calling execv(). 00301 */ 00302 char **argv = (char **)malloc(sizeof(*argv) * (vargv.size())); 00303 if(argv == NULL) 00304 return NULL; 00305 00306 for(size_t i = 0; i < vargv.size(); i++){ 00307 argv[i] = vargv[i]; 00308 } 00309 00310 return argv; 00311 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BaseString & BaseString::assfmt | ( | const char * | ftm, | |
| ... | ||||
| ) |
Assigns from a format string a la printf().
Definition at line 120 of file BaseString.cpp.
References basestring_vsnprintf(), buf, m_chr, m_len, and strlen().
Referenced by MgmtSrvr::alloc_node_id(), check_node_vs_replicas(), CommandInterpreter::connect(), TransporterRegistry::connect_ndb_mgmd(), Ndbfs::execREAD_CONFIG_REQ(), MgmtSrvr::getConnectionDbParameter(), OpenFiles::insert(), Ndb::internalize_index_name(), Ndb::internalize_table_name(), load_defaults(), CPCD::loadProcessList(), ndb_mgm_alloc_nodeid(), ndb_mgm_restart3(), ndb_mgm_stop3(), NdbImpl::NdbImpl(), Ndb::old_internalize_index_name(), InitConfigFileParser::parse_mycnf(), parse_where(), LocalConfig::parseString(), LocalConfig::readConnectString(), LocalConfig::readFile(), MgmtSrvr::sendStopMgmd(), MgmtSrvr::setConnectionDbParameter(), MgmtSrvr::setDbParameter(), MgmtSrvr::startEventLog(), NdbImpl::update_prefix(), and NdbTableImpl::updateMysqlName().
00121 { 00122 char buf[1]; 00123 va_list ap; 00124 int l; 00125 00126 /* Figure out how long the formatted string will be. A small temporary 00127 * buffer is used, because I don't trust all implementations to work 00128 * when called as vsnprintf(NULL, 0, ...). 00129 */ 00130 va_start(ap, fmt); 00131 l = basestring_vsnprintf(buf, sizeof(buf), fmt, ap) + 1; 00132 va_end(ap); 00133 if(l > (int)m_len) { 00134 delete[] m_chr; 00135 m_chr = new char[l]; 00136 } 00137 va_start(ap, fmt); 00138 basestring_vsnprintf(m_chr, l, fmt, ap); 00139 va_end(ap); 00140 m_len = strlen(m_chr); 00141 return *this; 00142 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BaseString & BaseString::assign | ( | const Vector< BaseString > & | vector, | |
| const BaseString & | separator = BaseString(" ") | |||
| ) | [inline] |
Assings from a Vector of BaseStrings, each Vector entry separated by separator.
| vector | Vector of BaseStrings to append | |
| separator | Separation between appended strings |
Definition at line 272 of file BaseString.hpp.
References append(), assign(), and separator.
Here is the call graph for this function:

| BaseString & BaseString::assign | ( | const BaseString & | str, | |
| size_t | n | |||
| ) |
| BaseString & BaseString::assign | ( | const char * | s, | |
| size_t | n | |||
| ) |
| BaseString & BaseString::assign | ( | const BaseString & | str | ) | [inline] |
Assigns from another BaseString.
Definition at line 266 of file BaseString.hpp.
References assign(), and m_chr.
Here is the call graph for this function:

| BaseString & BaseString::assign | ( | const char * | s | ) |
Assigns from a char *.
Definition at line 53 of file BaseString.cpp.
References m_chr, m_len, memcpy, n, and strlen().
Referenced by NdbUndofileImpl::assign(), NdbDatafileImpl::assign(), NdbLogfileGroupImpl::assign(), NdbTablespaceImpl::assign(), NdbTableImpl::assign(), assign(), NdbDictInterface::create_index_obj_from_table(), NdbDictInterface::createOrAlterTable(), NdbDictionaryImpl::createTable(), Ndbfs::execREAD_CONFIG_REQ(), Configuration::fetch_configuration(), NdbDictInterface::get_file(), NdbDictInterface::get_filegroup(), MgmtSrvr::getConnectionDbParameter(), InitIndex::init(), Ndb::internalize_index_name(), Ndb::internalize_table_name(), MgmtSrvr::MgmtSrvr(), ndb_mgm_get_status(), Ndb::old_internalize_index_name(), operator=(), NdbDictInterface::parseFilegroupInfo(), NdbDictInterface::parseFileInfo(), NdbDictInterface::parseTableInfo(), Ndb::setCatalogName(), MgmtSrvr::setConnectionDbParameter(), MgmtSrvr::setDbParameter(), NdbDictionary::Tablespace::setDefaultLogfileGroup(), NdbDictionary::Column::setDefaultValue(), ConfigRetriever::setError(), NdbDictionary::Undofile::setLogfileGroup(), NdbEventImpl::setName(), NdbIndexImpl::setName(), NdbTableImpl::setName(), NdbDictionary::LogfileGroup::setName(), NdbDictionary::Tablespace::setName(), NdbDictionary::Column::setName(), NdbDictionary::Undofile::setPath(), NdbDictionary::Datafile::setPath(), Ndb::setSchemaName(), NdbEventImpl::setTable(), NdbIndexImpl::setTable(), NdbDictionary::Datafile::setTablespace(), NdbDictionary::Table::setTablespace(), Ndb::setup(), MgmtSrvr::startEventLog(), substr(), and NdbTableImpl::updateMysqlName().
00054 { 00055 const size_t n = strlen(s); 00056 char* t = new char[n + 1]; 00057 memcpy(t, s, n + 1); 00058 delete[] m_chr; 00059 m_chr = t; 00060 m_len = n; 00061 return *this; 00062 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char * BaseString::c_str | ( | ) | const [inline] |
Returns a C-style string.
Definition at line 195 of file BaseString.hpp.
References m_chr.
Referenced by Logger::alert(), MgmtSrvr::alloc_node_id(), ConfigRetriever::allocNodeId(), NdbDictionaryImpl::alterTable(), LogHandler::append_impl(), check_node_vs_replicas(), ConfigRetriever::ConfigRetriever(), CommandInterpreter::connect(), TransporterRegistry::connect_ndb_mgmd(), NdbDictInterface::create_file(), NdbDictInterface::create_filegroup(), NdbDictionaryImpl::createDatafile(), NdbDictInterface::createEvent(), NdbDictionaryImpl::createEvent(), NdbDictInterface::createIndex(), NdbDictInterface::createOrAlterTable(), NdbDictionaryImpl::createTable(), NdbDictionaryImpl::createUndofile(), Logger::critical(), Logger::debug(), CPCD::defineProcess(), CPCD::Process::do_exec(), NdbDictionaryImpl::dropBlobTables(), NdbDictInterface::dropEvent(), NdbTableImpl::equal(), NdbColumnImpl::equal(), NdbOperation::equal_impl(), Logger::error(), HostMatch::eval(), Match::eval(), Qmgr::execCONTINUEB(), Ndbcntr::execCONTINUEB(), Ndbfs::execSTTOR(), Ndb_mgmclient::execute(), NdbDictionaryImpl::fetchGlobalTableImplRef(), fixPortNumber(), NdbDictionaryImpl::get_local_table_info(), Configuration::get_mgmd_host(), NdbDictionaryImpl::getBlobEvent(), NdbEventOperationImpl::getBlobHandle(), MgmtSrvr::getBlockNumber(), Ndb::getCatalogName(), NdbTableImpl::getColumn(), ConfigRetriever::getConfig(), MgmApiSession::getConnectionParameter(), NdbDictionary::Tablespace::getDefaultLogfileGroup(), NdbDictionary::Column::getDefaultValue(), ConfigRetriever::getErrorString(), NdbDictionaryImpl::getIndexTable(), NdbDictionary::Undofile::getLogfileGroup(), NdbTableImpl::getMysqlName(), NdbEventImpl::getName(), NdbIndexImpl::getName(), NdbTableImpl::getName(), NdbDictionary::LogfileGroup::getName(), NdbDictionary::Tablespace::getName(), NdbDictionary::Column::getName(), NdbTransaction::getNdbIndexOperation(), NdbDictionary::Undofile::getPath(), NdbDictionary::Datafile::getPath(), Ndb::getSchemaName(), NdbIndexImpl::getTable(), NdbOperation::getTableName(), NdbEventImpl::getTableName(), NdbDictionary::Datafile::getTablespace(), getTextNDBStopCompleted(), getTextNDBStopForced(), Logger::info(), BackupRestore::init(), Ndb::initAutoIncrement(), OpenFiles::insert(), insert_file(), Ndb::internalize_index_name(), Ndb::internalize_table_name(), NdbDictionaryImpl::invalidateObject(), is_ndb_blob_table(), NdbDictInterface::listObjects(), load_defaults(), CPCD::loadProcessList(), Ndb_mgmd_event_service::log(), Dblqh::logLqhkeyrefLab(), main(), MgmtSrvr::MgmtSrvr(), ndb_mgm_alloc_nodeid(), ndb_mgm_call(), ndb_mgm_dump_state(), ndb_mgm_enter_single_user(), ndb_mgm_get_version(), ndb_mgm_insert_error(), ndb_mgm_listen_event_internal(), ndb_mgm_log_signals(), ndb_mgm_report_event(), ndb_mgm_restart3(), ndb_mgm_set_clusterlog_loglevel(), ndb_mgm_set_clusterlog_severity_filter(), ndb_mgm_set_loglevel_node(), ndb_mgm_set_trace(), ndb_mgm_start(), ndb_mgm_start_backup(), ndb_mgm_start_signallog(), ndb_mgm_stop3(), ndb_mgm_stop_signallog(), Ndb::old_internalize_index_name(), InitConfigFileParser::parse_mycnf(), CPCD::Process::print(), CPCD::Process::Process(), GlobalDictCache::put(), NdbDictionaryImpl::putTable(), MgmtSrvr::readConfig(), LocalConfig::readConnectString(), LocalConfig::readFile(), GlobalDictCache::release(), NdbDictionaryImpl::releaseIndexGlobal(), NdbDictionaryImpl::releaseTableGlobal(), NdbDictionaryImpl::removeCachedObject(), reportShutdown(), MgmtSrvr::saveConfig(), CPCD::saveProcessList(), MgmtSrvr::sendStopMgmd(), Filename::set(), set_ulimit(), Ndb::setDatabaseAndSchemaName(), FileLogHandler::setMaxSize(), NdbOperation::setValue(), MgmtSrvr::start(), CPCD::Process::start(), MgmtSrvr::startEventLog(), NdbImpl::update_prefix(), and Logger::warning().
00196 { 00197 return m_chr; 00198 }
Here is the caller graph for this function:

| void BaseString::clear | ( | ) | [inline] |
Clear a string.
Definition at line 213 of file BaseString.hpp.
Referenced by NdbDictInterface::createOrAlterTable(), and NdbTableImpl::init().
00214 { 00215 delete[] m_chr; 00216 m_chr = new char[1]; 00217 m_chr[0] = 0; 00218 m_len = 0; 00219 }
Here is the caller graph for this function:

| bool BaseString::empty | ( | ) | const [inline] |
Checks if the string is empty.
Definition at line 207 of file BaseString.hpp.
References m_len.
Referenced by NdbTableImpl::assign(), NdbDictInterface::createOrAlterTable(), NdbDictionaryImpl::createTable(), and NdbTableImpl::getName().
00208 { 00209 return m_len == 0; 00210 }
Here is the caller graph for this function:

| ssize_t BaseString::indexOf | ( | char | c | ) |
Returns the index of the first occurance of the character c.
c character to look for
Definition at line 200 of file BaseString.cpp.
References m_chr, NULL, p, and strchr().
00200 { 00201 char *p; 00202 p = strchr(m_chr, c); 00203 if(p == NULL) 00204 return -1; 00205 return (ssize_t)(p-m_chr); 00206 }
Here is the call graph for this function:

| ssize_t BaseString::lastIndexOf | ( | char | c | ) |
Returns the index of the last occurance of the character c.
c character to look for
Definition at line 209 of file BaseString.cpp.
References m_chr, NULL, p, and strrchr().
00209 { 00210 char *p; 00211 p = strrchr(m_chr, c); 00212 if(p == NULL) 00213 return -1; 00214 return (ssize_t)(p-m_chr); 00215 }
Here is the call graph for this function:

| unsigned BaseString::length | ( | ) | const [inline] |
Returns the length of the string.
Definition at line 201 of file BaseString.hpp.
References m_len.
Referenced by MgmtSrvr::alloc_node_id(), check_node_vs_replicas(), NdbTableImpl::getColumn(), insert_file(), NdbDictInterface::listObjects(), ndb_tolower(), ndb_toupper(), MgmtSrvr::readConfig(), LocalConfig::readFile(), MgmtSrvr::sendStopMgmd(), Filename::set(), MgmtSrvr::startEventLog(), and substr().
00202 { 00203 return m_len; 00204 }
Here is the caller graph for this function:

| BaseString & BaseString::ndb_tolower | ( | ) | [inline] |
| BaseString & BaseString::ndb_toupper | ( | ) | [inline] |
| bool BaseString::operator!= | ( | const char * | str | ) | const [inline] |
| bool BaseString::operator!= | ( | const BaseString & | str | ) | const [inline] |
| bool BaseString::operator< | ( | const BaseString & | str | ) | const [inline] |
| BaseString & BaseString::operator= | ( | const BaseString & | str | ) |
Assignment operator.
Definition at line 168 of file BaseString.cpp.
References assign().
00169 { 00170 if (this != &str) { 00171 this->assign(str); 00172 } 00173 return *this; 00174 }
Here is the call graph for this function:

| bool BaseString::operator== | ( | const char * | str | ) | const [inline] |
| bool BaseString::operator== | ( | const BaseString & | str | ) | const [inline] |
| int BaseString::snprintf | ( | char * | str, | |
| size_t | size, | |||
| const char * | format, | |||
| ... | ||||
| ) | [static] |
snprintf on some platforms need special treatment
Definition at line 346 of file BaseString.cpp.
References basestring_vsnprintf().
Referenced by add_a_connection(), SimulatedBlock::addRecSignalImpl(), SimulatedBlock::allocRecord(), Configuration::calcSizeAlt(), Restore::check_file_version(), Qmgr::check_readnodes_reply(), Qmgr::checkStartInterface(), Properties::contains(), FileLogHandler::createNewFile(), NdbDictInterface::createOrAlterTable(), AsyncFile::doStart(), CPCD::RequestStatus::err(), Qmgr::execCM_REGCONF(), Qmgr::execCM_REGREF(), Dblqh::execDEBUG_SIG(), Qmgr::execDISCONNECT_REP(), Dbdih::execDUMP_STATE_ORD(), Qmgr::execNDB_FAILCONF(), Dbdih::execREAD_NODESCONF(), Dbdih::execSTART_PERMREF(), Ndbcntr::execSYSTEM_ERROR(), SimulatedBlock::executeFunction(), Dbdict::execWAIT_GCP_REF(), Qmgr::failReportLab(), File_class::File_class(), Dblqh::findLogfile(), fixNodeHostname(), ErrorReporter::formatMessage(), ErrorReporter::formatTimeStampString(), Properties::get(), BackupRestore::get_table(), getBlockName(), ConfigRetriever::getConfig(), Properties::getCopy(), LogHandler::getDefaultHeader(), MgmtSrvr::getErrorText(), ArbitCode::getErrText(), SignalCounter::getText(), EventLogger::getText(), ArbitTicket::getText(), getTextArbitResult(), getTextArbitState(), getTextBackupAborted(), getTextBackupCompleted(), getTextBackupFailedToStart(), getTextBackupStarted(), getTextCM_REGCONF(), getTextCM_REGREF(), getTextCommunicationClosed(), getTextCommunicationOpened(), getTextConnected(), getTextConnectedApiVersion(), getTextCreateLogBytes(), getTextDeadDueToHeartbeat(), getTextDisconnected(), getTextEventBufferStatus(), getTextFIND_NEIGHBOURS(), getTextGCP_TakeoverCompleted(), getTextGCP_TakeoverStarted(), getTextGlobalCheckpointCompleted(), getTextGlobalCheckpointStarted(), getTextInfoEvent(), getTextJobStatistic(), getTextLCP_TakeoverCompleted(), getTextLCP_TakeoverStarted(), getTextLCPFragmentCompleted(), getTextLCPStoppedInCalcKeepGci(), getTextLocalCheckpointCompleted(), getTextLocalCheckpointStarted(), getTextMemoryUsage(), getTextMissedHeartbeat(), getTextNDBStartCompleted(), getTextNDBStartStarted(), getTextNDBStopAborted(), getTextNDBStopCompleted(), getTextNDBStopForced(), getTextNDBStopStarted(), getTextNODE_FAILREP(), getTextNodeFailCompleted(), getTextNR_CopyDict(), getTextNR_CopyDistr(), getTextNR_CopyFragDone(), getTextNR_CopyFragsCompleted(), getTextNR_CopyFragsStarted(), getTextOperationReportCounters(), getTextReceiveBytesStatistic(), getTextSendBytesStatistic(), getTextSentHeartbeat(), getTextSingleUser(), getTextStartLog(), getTextStartPhaseCompleted(), getTextStartREDOLog(), getTextStartReport(), getTextSTTORRYRecieved(), getTextTableCreated(), getTextTransporterError(), getTextTransReportCounters(), getTextUndoLogBlocked(), getTextUNDORecordsExecuted(), getTextWarningEvent(), LogHandler::getTimeAsString(), Properties::getTypeOf(), ErrorReporter::handleAssert(), handler_error(), LocalConfig::init(), ClusterConfiguration::init(), main(), LocalConfig::makeConnectString(), Dbdih::makeNodeGroups(), NDB_COMMAND(), ndb_mgm_connect(), File_class::open(), operator<<(), OSE_Receiver::OSE_Receiver(), OSE_Transporter::OSE_Transporter(), InitConfigFileParser::parseConfig(), Properties::print(), print(), printCREATE_TRIG_REQ(), printReport(), SimulatedBlock::progError(), propToString(), Properties::put(), Properties::put64(), LocalConfig::readFile(), CPCD::Process::readPid(), Dbdict::restartCreateTab_readTableConf(), AsyncFile::rmrfReq(), InitConfigFileParser::run_config_rules(), CPCD::saveProcessList(), Dbdih::selectMasterCandidateAndSend(), Dbtc::sendAbortedAfterTimeout(), Filename::set(), BackupFile::setCtlFile(), BackupFile::setDataFile(), BackupFile::setLogFile(), BackupFile::setName(), SimulatedBlock::signal_error(), SimulatedBlock::SimulatedBlock(), Dbdih::startFragment(), CPCD::Process::stop(), InitConfigFileParser::storeSection(), Qmgr::systemErrorBecauseOtherNodeFailed(), test_snprintf(), LogHandlerListUnitTest::testTraverseNext(), transformComputer(), transformConnection(), transformNode(), transformSystem(), ConfigRetriever::verifyConfig(), and CPCD::Process::writePid().
00347 { 00348 va_list ap; 00349 va_start(ap, format); 00350 int ret= basestring_vsnprintf(str, size, format, ap); 00351 va_end(ap); 00352 return(ret); 00353 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int BaseString::split | ( | Vector< BaseString > & | vector, | |
| const BaseString & | separator = BaseString(" "), |
|||
| int | maxSize = -1 | |||
| ) | const |
Split a string into a vector of strings. Separate the string where any character included in separator exists. Maximally maxSize entries are added to the vector, if more separators exist in the string, the remainder of the string will be appended to the last entry in the vector. The vector will not be cleared, so any existing strings in the vector will remain.
| separator | characters separating the entries | |
| vector | where the separated strings will be stored | |
| maximum | number of strings extracted |
Definition at line 177 of file BaseString.cpp.
References BaseString(), free, m_chr, Vector< T >::push_back(), separator, Vector< T >::size(), start(), strchr(), strdup(), and strlen().
Referenced by Logger::addHandler(), CPCD::Process::do_exec(), CommandInterpreter::execute_impl(), CommandInterpreter::executeEventReporting(), CommandInterpreter::executeLogLevel(), CommandInterpreter::executeRestart(), CommandInterpreter::executeStop(), Configuration::init(), insert(), insert_row(), ndb_mgm_get_status(), parse_query(), LogHandler::parseParams(), MgmApiSession::report_event(), set_ulimit(), BackupRestore::table(), and NdbTableImpl::updateMysqlName().
00179 { 00180 char *str = strdup(m_chr); 00181 int i, start, len, num = 0; 00182 len = strlen(str); 00183 for(start = i = 0; 00184 (i <= len) && ( (maxSize<0) || ((int)v.size()<=maxSize-1) ); 00185 i++) { 00186 if(strchr(separator.c_str(), str[i]) || i == len) { 00187 if(maxSize < 0 || (int)v.size() < maxSize-1) 00188 str[i] = '\0'; 00189 v.push_back(BaseString(str+start)); 00190 num++; 00191 start = i+1; 00192 } 00193 } 00194 free(str); 00195 00196 return num; 00197 }
Here is the call graph for this function:

Here is the caller graph for this function:

| BaseString BaseString::substr | ( | ssize_t | start, | |
| ssize_t | stop = -1 | |||
| ) |
Returns a subset of a string
| start | index of first character | |
| stop | index of last character |
Definition at line 218 of file BaseString.cpp.
References assign(), BaseString(), length(), and m_chr.
00218 { 00219 if(stop < 0) 00220 stop = length(); 00221 ssize_t len = stop-start; 00222 if(len <= 0) 00223 return BaseString(""); 00224 BaseString s; 00225 s.assign(m_chr+start, len); 00226 return s; 00227 }
Here is the call graph for this function:

| char * BaseString::trim | ( | char * | src, | |
| const char * | delim | |||
| ) | [static] |
Trim string from delim
Definition at line 321 of file BaseString.cpp.
References memmove, pos(), strchr(), and strlen().
00321 { 00322 int len = strlen(str) - 1; 00323 for(; len > 0 && strchr(delim, str[len]); len--); 00324 00325 int pos = 0; 00326 for(; pos <= len && strchr(delim, str[pos]); pos++); 00327 00328 if(pos > len){ 00329 str[0] = 0; 00330 return 0; 00331 } else { 00332 memmove(str, &str[pos], len - pos + 1); 00333 str[len-pos+1] = 0; 00334 } 00335 00336 return str; 00337 }
Here is the call graph for this function:

| BaseString & BaseString::trim | ( | const char * | delim = " \t" |
) |
Trim string from delim
Definition at line 314 of file BaseString.cpp.
References m_chr, m_len, and strlen().
Referenced by CommandInterpreter::execute_impl(), insert(), insert_row(), ndb_mgm_get_status(), and LocalConfig::readFile().
Here is the call graph for this function:

Here is the caller graph for this function:

| int BaseString::vsnprintf | ( | char * | str, | |
| size_t | size, | |||
| const char * | format, | |||
| va_list | ap | |||
| ) | [static] |
Definition at line 340 of file BaseString.cpp.
References basestring_vsnprintf().
Referenced by fatal(), fatal_dict(), SimulatedBlock::infoEvent(), Logger::log(), ndbout_c(), InitConfigFileParser::Context::reportError(), InitConfigFileParser::Context::reportWarning(), setError(), vprint_socket(), vprintln_socket(), and SimulatedBlock::warningEvent().
00341 { 00342 return(basestring_vsnprintf(str, size, format, ap)); 00343 }
Here is the call graph for this function:

Here is the caller graph for this function:

char* BaseString::m_chr [private] |
Definition at line 190 of file BaseString.hpp.
Referenced by append(), assfmt(), assign(), BaseString(), c_str(), clear(), indexOf(), lastIndexOf(), ndb_tolower(), ndb_toupper(), operator!=(), operator<(), operator==(), split(), substr(), trim(), and ~BaseString().
unsigned BaseString::m_len [private] |
Definition at line 191 of file BaseString.hpp.
Referenced by append(), assfmt(), assign(), BaseString(), clear(), empty(), length(), and trim().
1.4.7

