Dr. Mario 64 Password Tool Version 1.1
A command-line tool written in C++ that allows to generate and decode the passwords of Dr. Mario 64.
Loading...
Searching...
No Matches
StringFunctions.cpp File Reference

Functions that handle the manipulation of strings. More...

#include <cstring>
#include "Constants.h"

Functions

string _GetExecutableName (char *ExecutableFullPath)
string _CenterString (string ToCenter="", bool PrintBorder=true, unsigned int SpacingLeft=StringCenterLeftSpacing, unsigned int Width=StringCenterWidth)
bool _OnlyDigits (char *String, unsigned int OffsetStart, unsigned int OffsetEnd)
bool _OnlyDigits (char *String)

Detailed Description

Functions that handle the manipulation of strings.

Author
WaluigiBSOD

Function Documentation

◆ _CenterString()

string _CenterString ( string ToCenter = "",
bool PrintBorder = true,
unsigned int SpacingLeft = StringCenterLeftSpacing,
unsigned int Width = StringCenterWidth )

Generates a centered string or separator.

Parameters
[in]ToCenterString to center, if empty generates a separator.
[in]PrintBorderPrints a surrounding border (true) or not (false).
[in]SpacingLeftAmount of left spacing.
[in]WidthWidth of the whole thing.
Returns
The generated string.
Author
WaluigiBSOD

◆ _GetExecutableName()

string _GetExecutableName ( char * ExecutableFullPath)

Computes the program's executable file name from the full path.

Parameters
[in]FullPathProgram's full path.
Returns
Program's executable name.
Author
WaluigiBSOD

◆ _OnlyDigits() [1/2]

bool _OnlyDigits ( char * String)

Checks if a string given in input is only numeric or not.

Parameters
[in]StringString to check.
Returns
True if the string given in input is only numeric, false if not.
Author
WaluigiBSOD

◆ _OnlyDigits() [2/2]

bool _OnlyDigits ( char * String,
unsigned int OffsetStart,
unsigned int OffsetEnd )

Checks if a string given in input is only numeric or not.

Parameters
[in]StringString to check.
[in]OffsetStartStarting index to consider.
[in]OffsetEndEnding index to consider.
Returns
True if the string given in input is only numeric, false if not.
Author
WaluigiBSOD