misc.h File Reference

miscellaneous functions which are used by ASC and all its tools More...

#include "global.h"
#include <string>

Include dependency graph for misc.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define dblue   lightgray

Functions

int getFirstBit (int i)
 Count the number of zero bits on the LSB side of "zahl".
char * strrr (int a)
 converts a to a string.
char * strrr (double a)
 converts a to a string.
int crc32buf (const void *vbuf, int len)
int atoi (const std::string &s)
double atof (const std::string &s)
template<typename T>
const T & min (const T &a, const T &b, const T &c)
template<typename T>
const T & max (const T &a, const T &b, const T &c)
char * strupr (const char *a)
char * itoa (int a, char *b, int c)

Variables

const char * digit []
const char * letter []


Detailed Description

miscellaneous functions which are used by ASC and all its tools

Definition in file misc.h.


Define Documentation

#define dblue   lightgray

Definition at line 33 of file misc.h.

Referenced by thelpsystem::buildgraphics(), tparagraph::checkscrolldown(), tdialogbox::editfield(), tresearchinfo::init(), EditAiParam::init(), tputresourcesdlg::init(), thelpsystem::init(), MultilineEdit::init(), tviewanytext::init(), tviewanytext::redraw(), tmessagedlg::setup(), showplayerstat(), and tshowhistorypaintstat().


Function Documentation

double atof ( const std::string &  s  ) 

Definition at line 153 of file misc.cpp.

References atof().

Referenced by atof(), ResourcePlacementDialog::buttonEvent(), FloatProperty::operation_eq(), DoubleArrayProperty::operation_eq(), IntegerProperty::operation_mult(), and FloatProperty::operation_mult().

int atoi ( const std::string &  s  ) 

Definition at line 148 of file misc.cpp.

References atoi().

Referenced by atoi(), ResourcePlacementDialog::buttonEvent(), tviewtext::evalcommand(), VersionIdentifier::fromString(), ReplayRecorderDialog::getASCFramerateLimit(), ReplayRecorderDialog::getFramerate(), getNumericVersion(), ReplayRecorderDialog::getQuality(), loadsinglemessagefile(), IntegerArrayProperty::operation_eq(), ASCImageArrayProperty::operation_eq(), SingleUnitSet::parseIDs(), SingleUnitSet::TranslationTable::parseString(), CopyMap::paste(), SingleUnitSet::read(), VehicleTypeRenderer::renderWidget(), ResourcePlacementDialog::ResourcePlacementDialog(), Password::setEncoded(), String2IntRangeVector(), and Password::write().

int crc32buf ( const void *  vbuf,
int  len 
)

Definition at line 129 of file misc.cpp.

References UPDC32.

Referenced by Password::encodepassword().

int getFirstBit ( int  i  ) 

Count the number of zero bits on the LSB side of "zahl".

Definition at line 45 of file misc.cpp.

References log().

Referenced by attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), MapRenderer::bitmappedHeight2pass(), ConstructBuildingCommand::buildingProductionPrerequisites(), UnitPropertyEditor::buttonpressed(), ContainerBase::calcShadowDist(), ColorConverter< 1, 4 >::ColorConverter(), Vehicle::decreaseMovement(), MapDisplayPG::displayAddons(), fieldAccessible(), DestructBuildingCommand::getFields(), Message::getFromText(), Vehicle::getHeightChange(), getheightdelta(), getmaxwindspeedforunit(), GuiFunctions::AttackGui::getName(), MessageLineWidget::getName(), SingleWeapon::getScalarWeaponType(), AStar::getTravelTime(), Vehicle::getValueType(), WeapDist::getWeaponStrength(), Vehicle::hasMoved(), ColorMerger_AlphaHandler< 4 >::init(), tsearchreactionfireingunits::init(), Vehicle::maxMovement(), AttackPanel::painter(), ContainerBase::paintField(), BuildingType::read(), AiParameter::reset(), Vehicle::resetMovement(), MoveUnit::runAction(), MoveUnitCommand::searchFields(), Vehicle::setMovement(), AiParameter::setNewHeight(), stu_height(), Vehicle::vehicleconstructable(), and ContainerBase::vehicleLoadable().

char* itoa ( int  a,
char *  b,
int  c 
)

Definition at line 175 of file misc.cpp.

Referenced by tdialogbox::disablebutton(), tdialogbox::enablebutton(), int2string(), tdialogbox::intedit(), DataTab::setData(), strrd8d(), strrd8n(), strrd8u(), strrr(), strrrd8d(), strrrd8n(), and strrrd8u().

template<typename T>
const T& max ( const T &  a,
const T &  b,
const T &  c 
)

Definition at line 97 of file misc.h.

Referenced by TextRenderer::AreaWidth(), ColorMerger_Brightness< pixelsize >::assign(), AStar3D::AStar3D(), beeline(), calcMoveMalus(), MapDisplayPG::checkViewPosition(), MapDisplayPG::displayUnitMovement(), doresearch(), tdialogbox::enablebutton(), Vehicle::endOwnTurn(), BarGraphWidget::eventBlit(), BuildingTypeBaseWidget::getBuildingHeight(), UnitHooveringLogic::getEndurance(), ReplayMapDisplay::getUnitMovementDuration(), TextRenderer::layout(), VehicleType::maxSpeed(), ResourceGraphLayer::paintSingleField(), PlayerColorPanel::PlayerColorPanel(), MemoryStreamStorage::readfromstream(), runResearch(), AttackCommand::searchTargets(), Vehicle::setMovement(), GraphWidget::setRange(), ASCGUI_Window::setup(), SourcePixelSelector_CacheZoom< pixelSize, SourcePixelSelector_DirectSubRectangle< pixelSize > >::setZoom(), tshowhistorypaintstat(), viewmessages(), Building::write(), and writePNGtrim().

template<typename T>
const T& min ( const T &  a,
const T &  b,
const T &  c 
)

Definition at line 80 of file misc.h.

Referenced by AmmoTransferWindow::AmmoTransferWindow(), ColorMerger_Brightness< pixelsize >::assign(), TrainUnitCommand::avail(), compressrle(), ContainerBase::ContainerBase(), copy2screen(), BuildingTypeBaseWidget::display(), MapDisplayPG::displayUnitMovement(), BarGraphWidget::eventBlit(), tdialogbox::execbutton(), Vehicle::getAmmo(), Building::getAmmo(), Vehicle::getAvailableResource(), BuildingTypeBaseWidget::getBuildingHeight(), SourcePixelSelector_DirectSubRectangle< pixelSize >::getHeight(), SourcePixelSelector_DirectRectangle< pixelSize >::getHeight(), SourcePixelSelector_Rectangle< pixelsize >::getHeight(), ResourceTransferrable::getMax(), AmmoTransferrable::getMin(), Vehicle::getResource(), WeapDist::getWeaponStrength(), SourcePixelSelector_DirectSubRectangle< pixelSize >::getWidth(), SourcePixelSelector_DirectRectangle< pixelSize >::getWidth(), SourcePixelSelector_Rectangle< pixelsize >::getWidth(), TrainUnitCommand::go(), InternalAmmoTransferWindow::InternalAmmoTransferWindow(), MessageDialog::MessageDialog(), MessageSelectionWindow::messageSelected(), MiningGraph::MiningGraph(), VersionIdentifier::operator<(), VersionIdentifier::operator<=(), VersionIdentifier::operator==(), Vehicle::putAmmo(), Vehicle::putResource(), WholeMapRenderer::renderVisibility(), CGameOptions::runTextIO(), AttackCommand::searchTargets(), ContainerBase::setInternalResourceMaxPlus(), ContainerBase::setInternalResourcePlus(), SourcePixelSelector_Zoom< pixelsize >::setSize(), StartupScreen::StartupScreen(), tputresources::testfield(), MiningStation::testfield(), AmmoTransferrable::transfer(), ResourceTransferrable::transfer(), tshowhistorypaintstat(), viewmessages(), viewterraininfo(), Vehicle::write(), and writePNGtrim().

char* strrr ( double  a  ) 

converts a to a string.

Returns:
a pointer to a static array, which will be overwritten in the next call

Definition at line 70 of file misc.cpp.

References strstring.

char* strrr ( int  a  ) 

converts a to a string.

Returns:
a pointer to a static array, which will be overwritten in the next call

Definition at line 60 of file misc.cpp.

References itoa(), and strstring.

char* strupr ( const char *  a  ) 

Definition at line 160 of file misc.cpp.

References malloc().

Referenced by ASCStringHelpers::_Strupr().


Variable Documentation

const char* digit[]

Definition at line 37 of file misc.cpp.

Referenced by int2string().

const char* letter[]

Definition at line 38 of file misc.cpp.


Generated on Mon May 21 01:40:08 2012 for Advanced Strategic Command by  doxygen 1.5.1