My Project

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Functions
psfunctions.cpp File Reference
`#include "psfunctions.h"`

## Functions
unsigned int | countCharsOfType (const string &st, int(*filterFunction)(int args), int fromIdx=0, int toIdx=-1)
| Given a string will return the number of characters of a certain type. More...
unsigned int | countUppercase (const string &st)
| Given a string will return the number of uppercase characters. More...
unsigned int | countLowercase (const string &st)
| Given a string will return the number of lowercase characters. More...
int | isSymbol (int c)
| Returns 1 if the passed argument is a symbol. More...
int | isDigitOrSymbol (int c)
| Returns 1 if the passed argument is a digit or symbol. More...
unsigned int | countDigits (const string &st)
| Given a string will return the number of digits. More...
unsigned int | countSymbols (const string &st)
| Given a string will return the number of symbols. More...
string | toUpperString (const string &st)
| Returns an uppercase version of the received string. More...
unsigned int | middleDigitsOrSymbols (const string &st)
| Returns the number of digits and symbols that are not the first or last characters of the received string. More...
unsigned int | countConsecutive (const string &st, int(*filterFunction)(int args))
unsigned int | consecUppercase (const string &st)
| Given a string will return the number of uppercase characters that follow a character of that same type. More...
unsigned int | consecLowercase (const string &st)
| Given a string will return the number of lowercase characters that follow a character of that same type. More...
unsigned int | consecDigits (const string &st)
| Given a string will return the number of digits that follow a digit. More...

## Function Documentation

unsigned int consecDigits | ( | const string & | st | ) |

Given a string will return the number of digits that follow a digit.

Parameters

  st | string by reference to analyze

unsigned int consecLowercase | ( | const string & | st | ) |

Given a string will return the number of lowercase characters that follow a character of that same type.

Parameters

  st | string by reference to analyze

unsigned int consecUppercase | ( | const string & | st | ) |

Given a string will return the number of uppercase characters that follow a character of that same type.

Parameters

  st | string by reference to analyze

unsigned int countCharsOfType | ( | const string & | st,
|  | int(*)(int args) | filterFunction,
|  | int | fromIdx = `0`,
|  | int | toIdx = `-1`
| ) |  |

Given a string will return the number of characters of a certain type.

Given a string will return the number of characters of a certain type that follow a character of that same type.

Parameters

  st | string to analyze
  filterFunction | a function pointer to a function that returns 1 when a character of the type is given. For example, if function is islower, then countCharsOfType will count lowercase characters.
  fromIdx | index from where to start count
  toIdx | last index for count
  st | string to analyze
  filterFunction | a function pointer to a function that returns 1 when a character of the type is given. For example, if function is islower, then countConsecutive will count consecutive lowercase characters.

unsigned int countDigits | ( | const string & | st | ) |

Given a string will return the number of digits.

Parameters

  st | string by reference to analyze

unsigned int countLowercase | ( | const string & | st | ) |

Given a string will return the number of lowercase characters.

Parameters

  st | string by reference to analyze

unsigned int countSymbols | ( | const string & | st | ) |

Given a string will return the number of symbols.

Parameters

  st | string by reference to analyze

unsigned int countUppercase | ( | const string & | st | ) |

Given a string will return the number of uppercase characters.

Parameters

  st | string by reference to analyze

int isDigitOrSymbol | ( | int | c | ) |

Returns 1 if the passed argument is a digit or symbol.

Parameters

  c | the character to be analyzed.

int isSymbol | ( | int | c | ) |

Returns 1 if the passed argument is a symbol.

Parameters

  c | the character to be analyzed.

unsigned int middleDigitsOrSymbols | ( | const string & | st | ) |

Returns the number of digits and symbols that are not the first or last characters of the received string.

Parameters

  st | string by reference to analyze

string toUpperString | ( | const string & | st | ) |

Returns an uppercase version of the received string.

Parameters

  st | string by reference to analyze