common/utils.cc File Reference

#include <config.h>
#include "utils.h"
#include "xapian/error.h"
#include "safedirent.h"
#include "safeerrno.h"
#include <sys/types.h>
#include <cfloat>
#include <cmath>

Include dependency graph for utils.cc:

Go to the source code of this file.


Classes

class  dircloser

Namespaces

namespace  Xapian
 The Xapian namespace contains public interfaces for the Xapian library.
namespace  Xapian::Internal

Functions

bool file_exists (const string &fname)
 Return true if the file fname exists.
bool dir_exists (const string &fname)
 Return true if the directory dirname exists.
void removedir (const string &dirname)
 Remove a directory, and its contents.
bool Xapian::Internal::within_DBL_EPSILON (double a, double b)


Function Documentation

bool dir_exists ( const string &  fname  ) 

Return true if the directory dirname exists.

Definition at line 46 of file utils.cc.

References S_ISDIR, and stat().

Referenced by DEFINE_TESTCASE(), Xapian::DatabaseReplica::Internal::Internal(), and main().

bool file_exists ( const string &  fname  ) 

void removedir ( const string &  dirname  ) 

Remove a directory, and its contents.

If dirname doesn't refer to a file or directory, no error is generated.

Note - this doesn't currently cope with directories which contain subdirectories.

Definition at line 66 of file utils.cc.

References dirent::d_name, opendir(), readdir(), and unlink().

Referenced by Xapian::DatabaseReplica::Internal::apply_db_copy(), and Xapian::DatabaseReplica::Internal::remove_offline_db().


Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.