Main Page   Namespace List   Alphabetical List   Compound List   File List   Compound Members   File Members  

StringUtils.cpp File Reference

String processing utils. More...

#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>

Include dependency graph for StringUtils.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void replace_str (string &to_change, const string &to_find, const string &replace_with)
 replace all instances of a string with another

void remove_shell_chars (string &to_change)
 remove all special shell characters from to_change

void escape_shell_chars (string &to_change)
 escape all special shell characters from to_change

void expand_tilde (string &tochange)
 expands the ~ character in a string to the users home directory

bool make_dir (const std::string &dir)
 make a directory creating any parent directories as necessary


Detailed Description

String processing utils.

Author:
Cameron Dorrat
Date:
Sun Dec 1 20:08:46 2002

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file StringUtils.cpp.


Function Documentation

void escape_shell_chars string &    to_change
 

escape all special shell characters from to_change

Parameters:
to_change the string to modify

Definition at line 78 of file StringUtils.cpp.

Referenced by PlayListConverter::insert_subst().

void expand_tilde string &    tochange
 

expands the ~ character in a string to the users home directory

Note:
doesnt replace ~username references
Parameters:
tochange teh string to modify

Definition at line 98 of file StringUtils.cpp.

Referenced by PlayListConverter::change_working_dir(), PlayListConverter::get_config_file(), PlayListConverter::load_config(), and PlayListConverter::load_format().

bool make_dir const std::string &    dir
 

make a directory creating any parent directories as necessary

Parameters:
dir the directory to make
Returns:
true on success

Definition at line 115 of file StringUtils.cpp.

Referenced by PlayListConverter::change_working_dir(), and PlayListConverter::open_output().

void remove_shell_chars string &    to_change
 

remove all special shell characters from to_change

Parameters:
to_change the string to modify

Definition at line 60 of file StringUtils.cpp.

Referenced by PlayListConverter::insert_subst().

void replace_str string &    to_change,
const string &    to_find,
const string &    replace_with
 

replace all instances of a string with another

Parameters:
to_change the string to modify
to_find the string to replace
replace_with the value to replace the string with

Definition at line 45 of file StringUtils.cpp.


Generated on Sat May 3 09:16:15 2003 for empxform by doxygen1.3-rc3