output.hh (8734:79592b2b1d55) output.hh (9398:6a348f61220c)
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;

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

47 map_t files;
48
49 /** Name of this directory */
50 std::string dir;
51
52 /** System-specific path separator character */
53 static const char PATH_SEPARATOR = '/';
54
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;

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

47 map_t files;
48
49 /** Name of this directory */
50 std::string dir;
51
52 /** System-specific path separator character */
53 static const char PATH_SEPARATOR = '/';
54
55 /**
56 * Returns relative file names prepended with name of this directory.
57 * Returns absolute file names unaltered.
58 *
59 * @param name file name to prepend with directory name
60 * @return file name prepended with base directory name or unaltered
61 * absolute file name
62 */
63 std::string resolve(const std::string &name) const;
64
65 protected:
66 /**
67 * Determines whether given file name corresponds to standard output
68 * streams.
69 *
70 * @param name name of file to check
71 * @return output stream for standard output or error stream if name
72 * corresponds to one or the other; NULL otherwise
73 */
74 std::ostream *checkForStdio(const std::string &name) const;
75
76 public:
77 /** Constructor. */
78 OutputDirectory();
79
80 /** Destructor. */
81 ~OutputDirectory();
82
55 protected:
56 /**
57 * Determines whether given file name corresponds to standard output
58 * streams.
59 *
60 * @param name name of file to check
61 * @return output stream for standard output or error stream if name
62 * corresponds to one or the other; NULL otherwise
63 */
64 std::ostream *checkForStdio(const std::string &name) const;
65
66 public:
67 /** Constructor. */
68 OutputDirectory();
69
70 /** Destructor. */
71 ~OutputDirectory();
72
73 /**
74 * Returns relative file names prepended with name of this directory.
75 * Returns absolute file names unaltered.
76 *
77 * @param name file name to prepend with directory name
78 * @return file name prepended with base directory name or unaltered
79 * absolute file name
80 */
81 std::string resolve(const std::string &name) const;
82
83 /** Opens a file (optionally compressed).
84 *
85 * Will open a file as a compressed stream if filename ends in .gz.
86 *
87 * @param filename file to open
88 * @param mode attributes to open file with
89 * @return stream pointer to opened file; will cause sim fail on error
90 */

--- 94 unchanged lines hidden ---
83 /** Opens a file (optionally compressed).
84 *
85 * Will open a file as a compressed stream if filename ends in .gz.
86 *
87 * @param filename file to open
88 * @param mode attributes to open file with
89 * @return stream pointer to opened file; will cause sim fail on error
90 */

--- 94 unchanged lines hidden ---