示例#1
0
void inject(ostream& dst, const string fname)
{
    if (alreadyIncluded.find(fname) == alreadyIncluded.end()) {
        alreadyIncluded.insert(fname);
        istream* src = open_arch_stream( fname.c_str());
        if (src) {
            streamCopy(*src, dst);
        } else {
            cerr << "NOT FOUND " << fname << endl;
        }
    }
}
示例#2
0
/**
 * Open architecture file.
 */
static istream* openArchFile (const string& filename)
{
	istream* file;
	getCurrentDir();	// Save the current directory.
	if ( (file = open_arch_stream(filename.c_str())) ) {
		//cerr << "Documentator : openArchFile : Opening '" << filename << "'" << endl;
	} else {
        stringstream error;
        error << "ERROR : can't open architecture file " << filename << endl;
        throw faustexception(error.str());
	}
	cholddir();			// Return to current directory.
	return file;
}
示例#3
0
/**
 * Inject file fname into dst ostream 
 */
static void inject(ostream& dst, const string& fname)
{
    if (gGlobal->gAlreadyIncluded.find(fname) == gGlobal->gAlreadyIncluded.end()) {
        gGlobal->gAlreadyIncluded.insert(fname);
        istream* src = open_arch_stream(fname.c_str());
        if (src) {
            streamCopy(*src, dst);
            delete src;
        } else {
            stringstream error;
            error << "NOT FOUND " << fname << endl;
            gGlobal->gErrorMsg = error.str();
        }
    }
}