file.h

Go to the documentation of this file.
00001 /****************************************************************
00002  *  Vidalia is distributed under the following license:
00003  *
00004  *  Copyright (C) 2006,  Matt Edman, Justin Hipple
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; either version 2
00009  *  of the License, or (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00019  *  Boston, MA  02110-1301, USA.
00020  ****************************************************************/
00021 
00022 /** 
00023  * \file file.h
00024  * \version $Id: file.h 1753 2007-05-26 05:36:24Z edmanm $
00025  * \brief Functions and definitions for common file I/O operations
00026  */
00027 
00028 #ifndef _FILE_H
00029 #define _FILE_H
00030 
00031 #include <QString>
00032 #include "string.h"
00033 
00034 
00035 /**  Create an empty file named <b>filename</b>. if <b>createdir</b> is true,
00036  * then the full path to <b>filename</b> will be created. Returns true on 
00037  * success, or false on error and <b>errmsg</b> will be set. */
00038 bool touch_file(QString filename, bool createdir = false, QString *errmsg = 0);
00039 
00040 /** Creates all directories in <b>path</b>, if they do not exist. */
00041 bool create_path(QString path);
00042 
00043 /** Expands <b>filename</b> if it starts with "~/". On Windows, this will
00044  * expand "%APPDATA%" and "%PROGRAMFILES%". If <b>filename</b> does not
00045  * start with a shortcut, <b>filename</b> will be returned unmodified. */
00046 QString expand_filename(QString filename);
00047 
00048 #endif
00049 

Generated on Wed Sep 5 15:49:27 2007 for Vidalia by  doxygen 1.5.3