/* Open named file or stdin if name is "-". Store pointer to stream obj in
dest and return it (except when it points to an object which should not be
deleted by the caller; in this case return null). */
-istream* openForInput(istream*& dest, const string& name) throw(Cleanup) {
+istream* openForInput(istream*& dest, const string& name) {
if (name == "-") {
/* EEEEK! There's no standard way to switch mode of cin to binary. (There
might be an implementation-dependent way? close()ing and re-open()ing
}
#endif
-ostream* openForOutput(ostream*& dest, const string& name) throw(Cleanup) {
+ostream* openForOutput(ostream*& dest, const string& name) {
if (name == "-") {
dest = reinterpret_cast<ostream*>(&cout); // EEEEK!
return 0;
}
//______________________________________________________________________
-void JigdoDesc::seekFromEnd(bistream& file) throw(JigdoDescError) {
+void JigdoDesc::seekFromEnd(bistream& file) {
file.seekg(-6, ios::end);
debug("JigdoDesc::seekFromEnd0: now at file offset %1",
static_cast<uint64>(file.tellg()));
}
//______________________________________________________________________
-bistream& JigdoDescVec::get(bistream& file)
- throw(JigdoDescError, bad_alloc) {
+bistream& JigdoDescVec::get(bistream& file) {
/* Need auto_ptr: If we did a direct push_back(new JigdoDesc), the
"new" might succeed, but the push_back() fail with bad_alloc =>
mem leak */
/** Assuming that a DESC section is at the end of a file, set the
file pointer to the start of the section, allowing you to call
read() immediately afterwards. */
- static void seekFromEnd(bistream& file) throw(JigdoDescError);
+ static void seekFromEnd(bistream& file);
/** Create image file from template and files (via JigdoCache) */
static int makeImage(JigdoCache* cache, const string& imageFile,
const string& imageTmpFile, const string& templFile,
the "DESC" must have been read already. If error is thrown,
position of file pointer is undefined. A type 1 (IMAGE_INFO)
will end up at this->back(). */
- bistream& get(bistream& file) throw(JigdoDescError, bad_alloc);
+ bistream& get(bistream& file);
/** Write a DESC section to a binary stream. Note that there should
not be two contiguous Unmatched regions - this is not checked.
}
//________________________________________
-inline bistream& operator>>(bistream& s, JigdoDescVec& v)
- throw(JigdoDescError, bad_alloc) {
+inline bistream& operator>>(bistream& s, JigdoDescVec& v) {
return v.get(s);
}
a file from which filenames are read, in contrast, stays at the
head of "objectsFrom" until the file is closed, to allow for
proper error messages to be generated. */
-bool RecurseDir::getNextObjectName(string& result) throw(RecurseError) {
+bool RecurseDir::getNextObjectName(string& result) {
while (true) {
// Try to assign the name of an object (name or dir) to result
//________________________________________
bool RecurseDir::getName(string& result, struct stat* fileInfo,
- bool checkFiles)
- throw(RecurseError, bad_alloc) {
+ bool checkFiles) {
static struct stat fInfo;
if (fileInfo == 0) fileInfo = &fInfo;
before using cache entries. If false, only check whether cache entry
present and return it if so. */
bool getName(string& result, struct stat* fileInfo = 0,
- bool checkFiles = true)
- throw(RecurseError, bad_alloc);
+ bool checkFiles = true);
/** Flush list of "already visited device/inode pairs", which would
otherwise be skipped during further scanning of filenames. */
string curDir;
stack<Level> recurseStack;
- inline bool getNextObjectName(string& result)
- throw(RecurseError);
+ inline bool getNextObjectName(string& result);
queue<string> objects; // Queue of filenames to output/dirs to recurse into
queue<string> objectsFrom; // Files containing filenames
ifstream fileList; // Was head of objectsFrom once, now has been opened