38 class StoreLockEntry ;
49 G_EXCEPTION( InvalidDirectory ,
"invalid spool directory" ) ;
51 Store(
G::Path spool_dir ,
bool by_name ,
bool allow_delete ) ;
66 void operator=(
const Store & ) ;
67 static void checkPath(
G::Path ,
bool ,
bool ) ;
68 static bool valid(
G::Path ,
bool ) ;
84 typedef unsigned long Size ;
103 G_EXCEPTION( CannotRead ,
"cannot read message file" ) ;
106 typedef std::list<Entry>
List ;
107 typedef void (*
Fn)(std::ostream&,
const std::string&) ;
114 void lock(
const std::string & user ) ;
135 std::string
uidl(
int id )
const ;
138 bool valid(
int id )
const ;
141 List
list(
int id = -1 )
const ;
144 std::auto_ptr<std::istream>
get(
int id )
const ;
166 explicit File(
const G::Path & ) ;
167 File(
const std::string & name_ ,
const std::string & size_string ) ;
168 bool operator<(
const File & )
const ;
171 typedef std::set<File> Set ;
176 Set::iterator find(
const std::string & ) ;
177 Set::const_iterator find(
int id )
const ;
178 Set::iterator find(
int id ) ;
179 void doCommit(
Store & )
const ;
181 G::Path path(
const std::string & ,
bool fallback )
const ;
182 std::string envelopeName(
const std::string & )
const ;
183 std::string contentName(
const std::string & )
const ;
184 G::Path contentPath(
const std::string & )
const ;
185 G::Path contentPath(
const File & )
const ;
186 G::Path envelopePath(
const File & )
const ;
187 void deleteFile(
const G::Path & ,
bool & )
const ;
188 bool unlinked(
Store & ,
const File & )
const ;
G::Path dir() const
Returns the spool directory path.
void rollback()
Rolls back remove()als but retains the lock.
bool locked() const
Returns true if locked.
StoreLockEntry::Size Size
Store(G::Path spool_dir, bool by_name, bool allow_delete)
Constructor.
StoreLockEntry(int id_, Size size_, const std::string &uidl_)
Size messageCount() const
Returns the store's message count.
Represents a file in the GPop::Store.
bool allowDelete() const
Returns true if files can be deleted.
Size totalByteCount() const
Returns the store's total byte count.
Represents an exclusive lock on the message store.
void lock(const std::string &user)
Initialisation.
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
Size byteCount(int id) const
Returns a message size.
void commit()
Commits remove()als.
bool byName() const
Returns true if the spool directory is affected by the user name.
bool valid(int id) const
Validates a message number.
StoreLock(Store &store)
Constructor.
void(* Fn)(std::ostream &, const std::string &)
A Path object represents a file system path.
List list(int id=-1) const
Lists messages in the store.
std::string uidl(int id) const
Returns a message's unique id.