#include <ascstring.h>
Inheritance diagram for ASCString:

Public Types | |
| typedef ASCStringHelpers::charT | charT |
| typedef ASCStringHelpers::NoncharT | NoncharT |
Public Member Functions | |
| ASCString () | |
| ASCString (const charT *pS) | |
| ASCString (const charT *pS, size_type n) | |
| ASCString (size_type n, charT c) | |
| ASCString (const_iterator first, const_iterator last) | |
| ASCString (const ASCCharTString &s) | |
| ASCString (const ASCCharTString &s, size_type pos, size_type n) | |
| ASCString (const ASCAdaptatorString &s) | |
| ASCString (const ASCAdaptatorString &s, size_type pos, size_type n) | |
| ASCString & | operator= (const ASCAdaptatorString &s) |
| ASCString & | operator= (const ASCCharTString &s) |
| ASCString & | operator= (const charT *pS) |
| int | compare_ci (const ASCCharTString &s) const |
| int | compare_ci (size_type p0, size_type n0, const ASCCharTString &s) |
| int | compare_ci (size_type p0, size_type n0, const ASCCharTString &s, size_type pos, size_type n) |
| int | compare_ci (const charT *pS) const |
| int | compare_ci (size_type p0, size_type n0, const charT *pS, size_type pos) const |
| ASCString & | replaceAll (const ASCString &old, const ASCString &newString) |
| replaces all occurances of old with newString | |
| ASCString & | replaceAll_ci (const ASCString &old, const ASCString &newString) |
| replaces all occurances of old with newString ; case insensitive | |
| ASCString & | toLower () |
| ASCString & | toUpper () |
| ASCString & | format (const charT *pFormat,...) |
| ASCString & | vaformat (const charT *pFormat, va_list ap) |
| void | printf () |
| bool | endswith (const ASCString &s) const |
| Checks if the last characters of string are equal to s. | |
Static Public Member Functions | |
| static ASCString | toString (int i) |
| converts the parameter to a String | |
| static ASCString | toString (double d) |
| converts the parameter to a String | |
Related Functions | |
| (Note that these are not member functions.) | |
| ASCString | copytoLower (const ASCString &String) |
| ASCString | copytoUpper (const ASCString &String) |
Depending on the prepocessor definition _UNICODE, ASCString will use Unicode text or C-null terminated char array.
ASCString* pStr = new ASCString( "My string" ); ASCInheritedString* pInherited = ( ASCInheritedString* ) pStr; // pStr's destructor will not be called when deleting pInherited. // If ASCString has been modified to free memory in its destructor, // this memory will never be freed up. delete pInherited;
Definition at line 13 of file ascstring.h.
charT is an alias to ASCStringHelpers::charT, the character type used to represent strings internally.
Definition at line 21 of file ascstring.h.
NoncharT is an alias to ASCStringHelpers::NoncharT, the complementary character type used to convert strings not using charT types.
Definition at line 29 of file ascstring.h.
| ASCString::ASCString | ( | ) | [inline] |
Construct an ASCString object.
Definition at line 103 of file ascstring.h.
| ASCString::ASCString | ( | const charT * | pS | ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| pS | a pointer to a NULL-terminated array of charT element types. |
Definition at line 113 of file ascstring.h.
| ASCString::ASCString | ( | const charT * | pS, | |
| size_type | n | |||
| ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| pS | a pointer to a NULL-terminated array of charT element types. | |
| n | the number of elements from pS to use to initialise the ASCString object. |
Definition at line 125 of file ascstring.h.
| ASCString::ASCString | ( | size_type | n, | |
| charT | c | |||
| ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| n | the repeat count of c. | |
| c | a single charT element type to be repeated n times. |
Definition at line 137 of file ascstring.h.
| ASCString::ASCString | ( | const_iterator | first, | |
| const_iterator | last | |||
| ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| first | a const iterator delimiting the begining of a range of charT element types to be used to construct this ASCString. | |
| last | a const iterator delimiting the ending of a range of charT element types to be used to construct this ASCString. |
Definition at line 151 of file ascstring.h.
| ASCString::ASCString | ( | const ASCCharTString & | s | ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| s | a const reference to an ASCCharTString object to be used to construct this ASCString. |
Definition at line 162 of file ascstring.h.
| ASCString::ASCString | ( | const ASCCharTString & | s, | |
| size_type | pos, | |||
| size_type | n | |||
| ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| s | a const reference to an ASCCharTString object to be used to construct this ASCString. | |
| pos | the position of the first character in s to be used to construct this ASCString. | |
| n | the count of characters used to construct this ASCString begining at position pos. |
Definition at line 176 of file ascstring.h.
| ASCString::ASCString | ( | const ASCAdaptatorString & | s | ) | [inline, explicit] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| s | a const reference to an ASCAdaptatorString object to be used to construct this ASCString. |
| range_error | The range_error exception is raised when not all the characters of ASCAdaptatorString can be converted to ASCCharTString's characters. |
Definition at line 195 of file ascstring.h.
References ASCStringHelpers::_ConvertToCharT().
| ASCString::ASCString | ( | const ASCAdaptatorString & | s, | |
| size_type | pos, | |||
| size_type | n | |||
| ) | [inline, explicit] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| s | a const reference to an ASCAdaptatorString object to be used to construct this ASCString. | |
| pos | the position of the first character in s to be used to construct this ASCString. | |
| n | the count of characters used to construct this ASCString begining at position pos. |
| range_error | The range_error exception is raised when not all the characters of ASCAdaptatorString can be converted to ASCCharTString's characters. |
Definition at line 223 of file ascstring.h.
References ASCStringHelpers::_ConvertToCharT().
| ASCString & ASCString::operator= | ( | const ASCAdaptatorString & | s | ) | [inline] |
| ASCString & ASCString::operator= | ( | const ASCCharTString & | s | ) | [inline] |
Assign a new value to an ASCString object.
| s | a const reference to an ASCCharTString object to be assigned to this ASCString. |
Definition at line 273 of file ascstring.h.
Definition at line 280 of file ascstring.h.
| int ASCString::compare_ci | ( | const ASCCharTString & | s | ) | const [inline] |
Compare two strings, case insensitive.
| s | a const reference to an ASCCharTString object to be used to construct this ASCString. |
Definition at line 294 of file ascstring.h.
References ASCStringHelpers::_Stricmp().
Referenced by NamedIntProperty::operation_eq(), TagIntProperty::operation_eq(), TagArrayProperty::operation_eq(), BoolProperty::operation_eq(), ASCGUI_Window::parsePanelASCTXT(), and TextFormatParser::startLevel().
| int ASCString::compare_ci | ( | size_type | p0, | |
| size_type | n0, | |||
| const ASCCharTString & | s | |||
| ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Compare the range [ p0 , n0 ] of this ASCString with the whole ASCCharTString.
Definition at line 304 of file ascstring.h.
References ASCStringHelpers::_Stricmp().
| int ASCString::compare_ci | ( | size_type | p0, | |
| size_type | n0, | |||
| const ASCCharTString & | s, | |||
| size_type | pos, | |||
| size_type | n | |||
| ) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Compare the range [ p0 , n0 ] of this ASCString with the range [ pos, n ] of ASCCharTString.
Definition at line 315 of file ascstring.h.
References ASCStringHelpers::_Stricmp().
| int ASCString::compare_ci | ( | const charT * | pS | ) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 325 of file ascstring.h.
References ASCStringHelpers::_Stricmp().
| int ASCString::compare_ci | ( | size_type | p0, | |
| size_type | n0, | |||
| const charT * | pS, | |||
| size_type | pos | |||
| ) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Compare the range [ p0 , n0 ] of this ASCString with up to [ 0, pos ] elements of pS.
Definition at line 335 of file ascstring.h.
References ASCStringHelpers::_Stricmp().
| ASCString ASCString::toString | ( | int | i | ) | [static] |
converts the parameter to a String
Definition at line 193 of file ascstring.cpp.
References format().
Referenced by ActionResult::ActionResult(), AllianceSetupWidget::AllianceSetupWidget(), tsearchreactionfireingunits::attack(), BuildingTypeCountWidget::BuildingTypeCountWidget(), BuildingTypeResourceWidget::BuildingTypeResourceWidget(), ChanceSettingsDialog::buildUpForm(), checkForUniqueUnitIDs(), PackageRepository::checkPackageDependency(), checkUnitsForCrash(), ChooseTech::ChooseTech(), FileTransfer::constructFileName(), DashboardPanel::DashboardPanel(), SavegameWidget::display(), ExperienceOverview::eventDraw(), StoringPosition::eventDraw(), EventEditor::EventEditor(), execaction_pg(), trunreplay::execnextreplaymove(), GuiFunctions::BuildVehicleCommand::execute(), executeUserAction(), CGameOptions::Mouse::getButtonName(), ContainerCommand::getContainer(), ContainerAction::getContainer(), TrainUnitCommand::getDescription(), SetResourceProcessingRateCommand::getDescription(), RepairUnitCommand::getDescription(), RepairBuildingCommand::getDescription(), RemoveProductionLineCommand::getDescription(), RemoveObject::getDescription(), RemoveMine::getDescription(), InflictDamage::getDescription(), DirectResearchCommand::getDescription(), DestructUnitCommand::getDescription(), ConvertContainer::getDescription(), ConsumeAmmo::getDescription(), ChangeUnitProperty::getDescription(), ChangeUnitMovement::getDescription(), ChangeObjectProperty::getDescription(), ChangeDiplomaticState::getDescription(), ChangeContainerProperty::getDescription(), CargoMoveCommand::getDescription(), CancelResearchCommand::getDescription(), BuildProductionLineCommand::getDescription(), SoundSystem::getDiagnosticText(), getDiplomaticStateImage(), WeatherAreaInformation::getInformation(), WindInformation::getInformation(), getInstances(), ActionResult::getMessage(), Player::getName(), CargoGuiFunctions::RecycleUnitCommandButton::getName(), getnextfilenumname(), getPlayerStrength(), getProductionString(), UnitAction::getUnit(), getVisibilityStatistics(), WeapDist::getWeaponStrength(), InvalidID::InvalidID(), Maped_MainScreenWidget::Maped_MainScreenWidget(), DashboardPanel::painter(), AttackPanel::painter(), UnitTrainingLayer::paintSingleField(), VisibilityLayer::paintSingleField(), ASCGUI_Window::parsePanelASCTXT(), PlayerColorPanel::PlayerColorPanel(), ObjectStorage< T >::print(), LuaCommandWriter::printCommand(), LuaCommandListRecorder< list< ASCString > >::printCommand(), GameAction::read(), VehicleTypeRenderer::renderWidget(), ReplayRecorderDialog::ReplayRecorderDialog(), resourceAnalysis(), UnitTypeTransformation::run(), SpawnUnit::runAction(), SpawnObject::runAction(), SpawnBuilding::runAction(), Package::runTextIO(), ObjectType::runTextIO(), Maped_MainScreenWidget::selectionChanged(), FileTransfer::send(), ASCGUI_Window::setLabelText(), Transferrable::show(), showCargoSummary(), showSDLInfo(), showUnitAiProperties(), DashboardPanel::showUnitData(), showUnitEndurance(), TechWidget::TechWidget(), testStreamEncoding1(), testStreamEncoding2(), toString::tos(), VersionIdentifier::toString(), VehicleCounterFactory::toString(), ASCImageArrayProperty::toString(), GameAction::undo(), SpawnUnit::undoAction(), SpawnObject::undoAction(), SpawnBuilding::undoAction(), DirectResearchCommand::undoAction(), ResearchWindow::update(), Maped_MainScreenWidget::updateStatusBar(), CargoDialog::updateVariables(), UnitInfoDialog::userHandler(), VehicleTypeCountWidget::VehicleTypeCountWidget(), VehicleTypeResourceWidget::VehicleTypeResourceWidget(), viewMiningPower(), viewterraininfo(), viewUnitSetinfo(), WeatherDialog::WeatherDialog(), WindSpeedSettingsDialog::WindSpeedSettingsDialog(), and writeMessageFile().
| ASCString ASCString::toString | ( | double | d | ) | [static] |
converts the parameter to a String
Definition at line 210 of file ascstring.cpp.
References format().
replaces all occurances of old with newString
Definition at line 231 of file ascstring.cpp.
Referenced by FileTransfer::send().
replaces all occurances of old with newString ; case insensitive
Definition at line 240 of file ascstring.cpp.
References copytoLower().
Referenced by FileTransfer::send().
| ASCString & ASCString::toLower | ( | ) |
Convert this ASCString to lowercase.
Definition at line 36 of file ascstring.cpp.
References ASCStringHelpers::_Strcpy(), and ASCStringHelpers::_Strlwr().
Referenced by copytoLower(), TextPropertyGroup::Entry::Entry(), PropertyContainer::find(), PropertyContainer::Property::findEntry(), Locale::getLocalizedFile(), loadASCFieldImage(), ItemSelectorWidget::nameMatch(), TextFormatParser::parseLine(), TextPropertyGroup::processAlias(), TechAdapter::runTextIO(), PropertyContainer::Property::setName(), ASCGUI_Window::setup(), and TextFormatParser::startLevel().
| ASCString & ASCString::toUpper | ( | ) |
Convert this ASCString to uppercase.
Definition at line 55 of file ascstring.cpp.
References ASCStringHelpers::_Strcpy(), and ASCStringHelpers::_Strupr().
Referenced by copytoUpper().
Format this ASCString as sprintf does.
| pFormat | a format-control string. | |
| ... | Optional arguments |
Definition at line 78 of file ascstring.cpp.
References vaformat().
Referenced by compareMapResources(), AttackPanel::dispValue(), StoringPosition::eventDraw(), TransferControlCommand::getCommandString(), TrainUnitCommand::getCommandString(), SetResourceProcessingRateCommand::getCommandString(), ServiceCommand::getCommandString(), RepairUnitCommand::getCommandString(), RepairBuildingCommand::getCommandString(), RenameContainerCommand::getCommandString(), RemoveProductionLineCommand::getCommandString(), RecycleUnitCommand::getCommandString(), ReactionFireSwitchCommand::getCommandString(), PutObjectCommand::getCommandString(), PutMineCommand::getCommandString(), PowerGenerationSwitchCommand::getCommandString(), MoveUnitCommand::getCommandString(), JumpDriveCommand::getCommandString(), InternalAmmoTransferCommand::getCommandString(), DirectResearchCommand::getCommandString(), DiplomacyCommand::getCommandString(), DestructUnitCommand::getCommandString(), DestructBuildingCommand::getCommandString(), ConstructUnitCommand::getCommandString(), ConstructBuildingCommand::getCommandString(), ChangeDiplomaticState::getCommandString(), CargoMoveCommand::getCommandString(), CancelResearchCommand::getCommandString(), BuildProductionLineCommand::getCommandString(), AttackCommand::getCommandString(), ResourceTribute::getDetailledName(), TurnPassed::getDetailledName(), tinvalidversion::getMessage(), GuiFunctions::ObjectBuildingGui::getName(), GuiFunctions::AttackGui::getName(), getPlayerStrength(), GetVideoModes::GetVideoModes(), DiplomacyCommand::go(), VisibilityLayer::paintSingleField(), printTech(), CargoDialog::setUnitInfoWidgets(), showUnitEndurance(), toString::tos(), MapCoordinate::toString(), Resources::toString(), DoubleArrayProperty::toString(), FloatProperty::toString(), toString(), transfer_all_outstanding_tribute(), ChangeView::undoAction(), and writeMessageFile().
Definition at line 91 of file ascstring.cpp.
References ASCStringHelpers::_Vsnprintf().
Referenced by displaymessage2(), fatalError(), format(), and MessagingHubBase::message().
| void ASCString::printf | ( | ) |
Print this ASCString to the standard output stream.
See standard system documentation for more information on printf.
Definition at line 137 of file ascstring.cpp.
References ASCStringHelpers::_Printf().
| bool ASCString::endswith | ( | const ASCString & | s | ) | const |
Checks if the last characters of string are equal to s.
Definition at line 146 of file ascstring.cpp.
Referenced by FileTransfer::constructFileName().
Duplicate and convert to lowercase.
| String | a const reference to an ASCString object which will be duplicated and converted to lowercase. |
Definition at line 167 of file ascstring.cpp.
References toLower().
Referenced by loadASCFieldImageArray(), and replaceAll_ci().
Duplicate and convert to uppercase.
| String | a const reference to an ASCString object which will be duplicated and converted to uppercase. |
Definition at line 185 of file ascstring.cpp.
References toUpper().
1.5.1