output.cc (4840:ad2beb0f9fd8) output.cc (5402:05c388940eb6)
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 84 unchanged lines hidden (view full) ---

93 return &cerr;
94
95 if (name == "cout" || name == "stdout")
96 return &cout;
97
98 ofstream *file = new ofstream(resolve(name).c_str(),
99 ios::trunc | binary ? ios::binary : (ios::openmode)0);
100 if (!file->is_open())
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 84 unchanged lines hidden (view full) ---

93 return &cerr;
94
95 if (name == "cout" || name == "stdout")
96 return &cout;
97
98 ofstream *file = new ofstream(resolve(name).c_str(),
99 ios::trunc | binary ? ios::binary : (ios::openmode)0);
100 if (!file->is_open())
101 panic("Cannot open file %s", name);
101 fatal("Cannot open file %s", name);
102
103 return file;
104}
105
106ostream *
107OutputDirectory::find(const string &name)
108{
109 if (name == "cerr" || name == "stderr")

--- 4 unchanged lines hidden (view full) ---

114
115 string filename = resolve(name);
116 map_t::iterator i = files.find(filename);
117 if (i != files.end())
118 return (*i).second;
119
120 ofstream *file = new ofstream(filename.c_str(), ios::trunc);
121 if (!file->is_open())
102
103 return file;
104}
105
106ostream *
107OutputDirectory::find(const string &name)
108{
109 if (name == "cerr" || name == "stderr")

--- 4 unchanged lines hidden (view full) ---

114
115 string filename = resolve(name);
116 map_t::iterator i = files.find(filename);
117 if (i != files.end())
118 return (*i).second;
119
120 ofstream *file = new ofstream(filename.c_str(), ios::trunc);
121 if (!file->is_open())
122 panic("Cannot open file %s", filename);
122 fatal("Cannot open file %s", filename);
123
124 files[filename] = file;
125 return file;
126}
127
128bool
129OutputDirectory::isFile(const std::ostream *os)
130{
131 return os && os != &cerr && os != &cout;
132}
123
124 files[filename] = file;
125 return file;
126}
127
128bool
129OutputDirectory::isFile(const std::ostream *os)
130{
131 return os && os != &cerr && os != &cout;
132}