- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- File List
- File Members

# sbuild-util.cc File Reference

`#include <config.h>`
`#include "sbuild-error.h"`
`#include "sbuild-util.h"`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <unistd.h>`

Include dependency graph for sbuild-util.cc:

## Functions
std::string | remove_duplicates (std::string const &str, char dup)
| Remove duplicate adjacent characters from a string.
std::string | sbuild::basename (std::string name, char separator= '/')
| Strip the directory path from a filename.
std::string | sbuild::dirname (std::string name, char separator= '/')
| Strip the fileame from a pathname.
std::string | sbuild::normalname (std::string name, char separator= '/')
| Normalise a pathname.
bool | sbuild::is_absname (std::string const &name)
| Check if a pathname is absolute.
std::string | sbuild::string_list_to_string (string_list const &list, std::string const &separator)
| Convert a string_list into a string.
string_list | sbuild::split_string (std::string const &value, std::string const &separator)
| Split a string into a string_list.
std::wstring | sbuild::widen_string (std::string const &str, std::locale locale)
| Widen a string.
std::string | sbuild::narrow_string (std::wstring const &str, std::locale locale)
| Narrow a string.
std::string | sbuild::find_program_in_path (std::string const &program, std::string const &path, std::string const &prefix)
| Find a program in the PATH search path.
char ** | sbuild::string_list_to_strv (string_list const &str)
| Create a string vector from a string_list.
void | sbuild::strv_delete (char **strv)
| Delete a string vector.
int | sbuild::exec (std::string const &file, string_list const &command, environment const &env)
| execve wrapper.

## Function Documentation

std::string @13::remove_duplicates | ( | std::string const & | str,
|  | char | dup |
| ) |  |  | `[static]`

Remove duplicate adjacent characters from a string.

Parameters:

  | str | the string to check.
  | dup | the duplicate character to check for.

Returns:
  a string with any duplicates removed.