libutil.cc File Reference

#include "AppHdr.h"
#include "defines.h"
#include "itemname.h"
#include "libutil.h"
#include "externs.h"
#include "macro.h"
#include "message.h"
#include "stuff.h"
#include "viewgeom.h"
#include <sstream>
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#include <string.h>

Include dependency graph for libutil.cc:


Functions

description_level_type description_type_by_name (const char *desc)
std::string number_to_string (unsigned number, bool in_words)
std::string apply_description (description_level_type desc, const std::string &name, int quantity, bool in_words)
bool shell_safe (const char *file)
void play_sound (const char *file)
std::string strip_filename_unsafe_chars (const std::string &s)
std::string vmake_stringf (const char *s, va_list args)
std::string make_stringf (const char *s,...)
std::stringescape_path_spaces (std::string &s)
void wait_for_keypress ()
bool key_is_escape (int key)
std::stringuppercase (std::string &s)
std::string upcase_first (std::string s)
std::stringlowercase (std::string &s)
std::string lowercase_string (std::string s)
int ends_with (const std::string &s, const char *suffixes[])
int stricmp (const char *str1, const char *str2)
bool strip_suffix (std::string &s, const std::string &suffix)
bool strip_tag (std::string &s, const std::string &tag, bool skip_padding)
std::string strip_tag_prefix (std::string &s, const std::string &tagprefix)
bool strip_bool_tag (std::string &s, const std::string &name, bool defval)
int strip_number_tag (std::string &s, const std::string &tagprefix)
std::string article_a (const std::string &name, bool lowercase)
std::string pluralise (const std::string &name, const char *qualifiers[], const char *no_qualifier[])
std::string apostrophise (const std::string &name)
std::string apostrophise_fixup (const std::string &msg)
std::string number_in_words (unsigned num, int pow)
std::string replace_all (std::string s, const std::string &find, const std::string &repl)
std::string replace_all_of (std::string s, const std::string &tofind, const std::string &replacement)
int count_occurrences (const std::string &text, const std::string &s)
std::string trimmed_string (std::string s)
std::stringtrim_string (std::string &str)
std::stringtrim_string_right (std::string &str)
std::vector< std::stringsplit_string (const std::string &sep, std::string s, bool trim_segments, bool accept_empty_segments, int nsplits)
coord_def cgettopleft (GotoRegion region)
coord_def cgetpos (GotoRegion region)
void cgotoxy (int x, int y, GotoRegion region)
GotoRegion get_cursor_region ()
coord_def cgetsize (GotoRegion region)
void cscroll (int n, GotoRegion region)
size_t strlcpy (char *dst, const char *src, size_t n)
int strwidth (const char *s)
int strwidth (const std::string &s)

Variables

const char * standard_plural_qualifiers []

Function Documentation

std::string apostrophise ( const std::string name  ) 

std::string apostrophise_fixup ( const std::string msg  ) 

Here is the call graph for this function:

std::string apply_description ( description_level_type  desc,
const std::string name,
int  quantity,
bool  in_words 
)

Here is the call graph for this function:

std::string article_a ( const std::string name,
bool  lowercase 
)

Here is the call graph for this function:

coord_def cgetpos ( GotoRegion  region  ) 

Here is the call graph for this function:

coord_def cgetsize ( GotoRegion  region  ) 

coord_def cgettopleft ( GotoRegion  region  ) 

void cgotoxy ( int  x,
int  y,
GotoRegion  region 
)

Here is the call graph for this function:

int count_occurrences ( const std::string text,
const std::string s 
)

Here is the call graph for this function:

void cscroll ( int  n,
GotoRegion  region 
)

Here is the call graph for this function:

description_level_type description_type_by_name ( const char *  desc  ) 

int ends_with ( const std::string s,
const char *  suffixes[] 
)

Returns 1 + the index of the first suffix that matches the given string, 0 if no suffixes match.

Here is the call graph for this function:

std::string& escape_path_spaces ( std::string s  ) 

GotoRegion get_cursor_region (  ) 

bool key_is_escape ( int  key  ) 

std::string& lowercase ( std::string s  ) 

std::string lowercase_string ( std::string  s  ) 

Here is the call graph for this function:

std::string make_stringf ( const char *  s,
  ... 
)

Here is the call graph for this function:

std::string number_in_words ( unsigned  num,
int  pow 
)

Here is the call graph for this function:

std::string number_to_string ( unsigned  number,
bool  in_words 
)

Here is the call graph for this function:

void play_sound ( const char *  file  ) 

Here is the call graph for this function:

std::string pluralise ( const std::string name,
const char *  qualifiers[],
const char *  no_qualifier[] 
)

Here is the call graph for this function:

std::string replace_all ( std::string  s,
const std::string find,
const std::string repl 
)

std::string replace_all_of ( std::string  s,
const std::string tofind,
const std::string replacement 
)

bool shell_safe ( const char *  file  ) 

std::vector<std::string> split_string ( const std::string sep,
std::string  s,
bool  trim_segments,
bool  accept_empty_segments,
int  nsplits 
)

Here is the call graph for this function:

int stricmp ( const char *  str1,
const char *  str2 
)

bool strip_bool_tag ( std::string s,
const std::string name,
bool  defval 
)

Here is the call graph for this function:

std::string strip_filename_unsafe_chars ( const std::string s  ) 

Here is the call graph for this function:

int strip_number_tag ( std::string s,
const std::string tagprefix 
)

Here is the call graph for this function:

bool strip_suffix ( std::string s,
const std::string suffix 
)

Here is the call graph for this function:

bool strip_tag ( std::string s,
const std::string tag,
bool  skip_padding 
)

Here is the call graph for this function:

std::string strip_tag_prefix ( std::string s,
const std::string tagprefix 
)

Here is the call graph for this function:

size_t strlcpy ( char *  dst,
const char *  src,
size_t  n 
)

int strwidth ( const std::string s  ) 

int strwidth ( const char *  s  ) 

std::string& trim_string ( std::string str  ) 

std::string& trim_string_right ( std::string str  ) 

std::string trimmed_string ( std::string  s  ) 

Here is the call graph for this function:

std::string upcase_first ( std::string  s  ) 

std::string& uppercase ( std::string s  ) 

std::string vmake_stringf ( const char *  s,
va_list  args 
)

void wait_for_keypress (  ) 

Here is the call graph for this function:


Variable Documentation

Initial value:

{
    " of ", " labeled ", NULL
}


Generated on Thu Jan 13 13:08:34 2011 by  doxygen 1.5.6