| Bsoft 2.0.5 Bernard's software package

Functions | Variables
Bstring.cpp File Reference

Functions in the string class. More...

`#include <stdio.h>`
`#include <string.h>`
`#include <ctype.h>`
`#include "Bstring.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
Bstring | operator+ (const char *c, const Bstring &s)
istream & | operator>> (istream &input, Bstring &s)
ostream & | operator<< (ostream &output, Bstring &s)
Bstring * | string_add (Bstring **list, const char *string)
| Adds a string to a linked list. More...
Bstring * | string_add (Bstring **list, Bstring &string)
Bstring | string_catenate (Bstring *list)
| Catenates a string linked list into one string. More...
int | string_kill (Bstring *list)
| Kills a string linked list. More...
Bstring | parameter_file_path (Bstring filename)
| Finds the parameter file path. More...
int | QsortSmallToLargeString (const void *x, const void *y)
| Utility function for sorting string lexically in qsort. More...
int | QsortLargeToSmallString (const void *x, const void *y)
| Utility function for sorting string lexically in qsort. More...
int | QsortSmallToLargeStringValue (const void *x, const void *y)
| Utility function for sorting string values in qsort. More...
int | QsortLargeToSmallStringValue (const void *x, const void *y)
| Utility function for sorting string values in qsort. More...
int | string_sort (Bstring *slist, int descending, int value)
| Sorts a list of strings in ascending (descending) lexical or value order. More...

## Variables
int | verbose

## Detailed Description

Functions in the string class.

Author
  Bernard Heymann

Date
  Created: 20051020
  Modified: 20190603

Definition in file Bstring.cpp.

## Function Documentation

## ◆ operator+()

Bstring operator+ | ( | const char * | c,
|  | const Bstring & | s
| ) |  |

Definition at line 681 of file Bstring.cpp.

## ◆ operator<<()

ostream& operator<< | ( | ostream & | output,
|  | Bstring & | s
| ) |  |

Definition at line 694 of file Bstring.cpp.

## ◆ operator>>()

istream& operator>> | ( | istream & | input,
|  | Bstring & | s
| ) |  |

Definition at line 687 of file Bstring.cpp.

## ◆ parameter_file_path()

Bstring parameter_file_path | ( | Bstring | filename | ) |

Finds the parameter file path.

Parameters

  &filename | the parameter filename.

Returns
  Bstring the full path and file name.

      The parameter file path should primarily be defined in the environmental
      variable "BPARAM".
      Otherwise a default is used which may or may not be valid.
      The string returned has a length containing the path plus one byte.

Definition at line 787 of file Bstring.cpp.

## ◆ QsortLargeToSmallString()

int QsortLargeToSmallString | ( | const void * | x,
|  | const void * | y
| ) |  |

Utility function for sorting string lexically in qsort.

Parameters

  *x | first string pointer.
  *y | second string pointer.

Returns
  -1 if x < y and 1 otherwise.

Definition at line 828 of file Bstring.cpp.

## ◆ QsortLargeToSmallStringValue()

int QsortLargeToSmallStringValue | ( | const void * | x,
|  | const void * | y
| ) |  |

Utility function for sorting string values in qsort.

Parameters

  *x | first string pointer.
  *y | second string pointer.

Returns
  -1 if x < y and 1 otherwise.

Definition at line 856 of file Bstring.cpp.

## ◆ QsortSmallToLargeString()

int QsortSmallToLargeString | ( | const void * | x,
|  | const void * | y
| ) |  |

Utility function for sorting string lexically in qsort.

Parameters

  *x | first string pointer.
  *y | second string pointer.

Returns
  int -1 if x < y and 1 otherwise.

Definition at line 814 of file Bstring.cpp.

## ◆ QsortSmallToLargeStringValue()

int QsortSmallToLargeStringValue | ( | const void * | x,
|  | const void * | y
| ) |  |

Utility function for sorting string values in qsort.

Parameters

  *x | first string pointer.
  *y | second string pointer.

Returns
  -1 if x < y and 1 otherwise.

Definition at line 842 of file Bstring.cpp.

## ◆ string_add() [1/2]

Bstring* string_add | ( | Bstring ** | list,
|  | const char * | string
| ) |  |

Adds a string to a linked list.

Parameters

  **list | the string linked list.
  &string | string - unchanged.

Returns
  Bstring* new string structure.

Definition at line 705 of file Bstring.cpp.

## ◆ string_add() [2/2]

Bstring* string_add | ( | Bstring ** | list,
|  | Bstring & | string
| ) |  |

Definition at line 711 of file Bstring.cpp.

## ◆ string_catenate()

Bstring string_catenate | ( | Bstring * | list | ) |

Catenates a string linked list into one string.

Parameters

  *list | the string linked list.

Returns
  Bstring new string.

Definition at line 739 of file Bstring.cpp.

## ◆ string_kill()

int string_kill | ( | Bstring * | list | ) |

Kills a string linked list.

Parameters

  *list | the string linked list.

Returns
  int 0.

Definition at line 760 of file Bstring.cpp.

## ◆ string_sort()

int string_sort | ( | Bstring * | slist,
|  | int | descending,
|  | int | value
| ) |  |

Sorts a list of strings in ascending (descending) lexical or value order.

Parameters

  *slist | string list.
  descending | flag to do a descending sort.
  value | sort in value order.

Returns
  int 0.

      The string list is first convert to an array, quicksorted, and
      written back into the string list.

Definition at line 875 of file Bstring.cpp.

## Variable Documentation

## ◆ verbose

int verbose