file.h

Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.vidalia-project.net/. No part of Vidalia, including this file,
00007 **  may be copied, modified, propagated, or distributed except according to the
00008 **  terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file file.h
00013 ** \version $Id: file.h 3511 2009-02-05 00:56:16Z edmanm $
00014 ** \brief Functions and definitions for common file I/O operations
00015 */
00016 
00017 #ifndef _FILE_H
00018 #define _FILE_H
00019 
00020 #include <QString>
00021 
00022 
00023 /**  Create an empty file named <b>filename</b>. if <b>createdir</b> is true,
00024  * then the full path to <b>filename</b> will be created. Returns true on 
00025  * success, or false on error and <b>errmsg</b> will be set. */
00026 bool touch_file(QString filename, bool createdir = false, QString *errmsg = 0);
00027 
00028 /** Creates all directories in <b>path</b>, if they do not exist. */
00029 bool create_path(QString path);
00030 
00031 /** Expands <b>filename</b> if it starts with "~/". On Windows, this will
00032  * expand "%APPDATA%" and "%PROGRAMFILES%". If <b>filename</b> does not
00033  * start with a shortcut, <b>filename</b> will be returned unmodified. */
00034 QString expand_filename(QString filename);
00035     
00036 /** Recursively copy the contents of one directory to another. The
00037  * destination must already exist. Returns true on success, and false
00038  * otherwise. */
00039 bool copy_dir(QString source, QString dest);
00040 
00041 #endif
00042 

Generated on Tue Jul 7 17:00:55 2009 for Vidalia by  doxygen 1.4.7