sbuild-util.cc File Reference

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

Include dependency graph for sbuild-util.cc:


Typedefs

typedef std::pair
< sbuild::stat::error_code,
const char * > 
emap

Functions

std::string remove_duplicates (std::string const &str, char dup)
 Remove duplicate adjacent characters from a string.
bool chroot_alphasort (sbuild::chroot::ptr const &c1, sbuild::chroot::ptr const &c2)
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.

Variables

emap init_errors []
 This is a list of the supported error codes.

Typedef Documentation

typedef std::pair<sbuild::stat::error_code,const char *> emap [static]


Function Documentation

bool @67::chroot_alphasort ( sbuild::chroot::ptr const &  c1,
sbuild::chroot::ptr const &  c2 
) [static]

std::string @67::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.

Referenced by sbuild::basename(), sbuild::dirname(), and sbuild::normalname().


Variable Documentation

emap init_errors[] [static]

Initial value:

    {
      emap(sbuild::stat::FILE, N_("Failed to stat file")),
      emap(sbuild::stat::FD,   N_("Failed to stat file descriptor"))
    }
This is a list of the supported error codes.

It's used to construct the real error codes map.


Generated on Sat Jul 5 11:59:46 2008 for sbuild by  doxygen 1.5.6