multovl  1.3
Multiple overlaps of genomic regions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
tempfile.hh
1 /* <LICENSE>
2 License for the MULTOVL multiple genomic overlap tools
3 
4 Copyright (c) 2007-2012, Dr Andras Aszodi,
5 Campus Science Support Facilities GmbH (CSF),
6 Dr-Bohr-Gasse 3, A-1030 Vienna, Austria, Europe.
7 All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are
11 met:
12 
13  * Redistributions of source code must retain the above copyright notice,
14  this list of conditions and the following disclaimer.
15  * Redistributions in binary form must reproduce the above copyright notice,
16  this list of conditions and the following disclaimer in the documentation
17  and/or other materials provided with the distribution.
18  * Neither the name of the Campus Science Support Facilities GmbH
19  nor the names of its contributors may be used to endorse
20  or promote products derived from this software without specific prior
21  written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
24 AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27 THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 </LICENSE> */
35 #ifndef MULTOVL_TEST_TEMPFILE_HEADER
36 #define MULTOVL_TEST_TEMPFILE_HEADER
37 
38 // == Header tempfile.hh ==
39 
40 // Little RAII utility to create/remove temporary files.
41 // \date 2011-12-02
42 
43 // -- Boost headers --
44 
45 // Use V3 of Boost::Filesystem, this is relevant between Boost versions 1.44 to 1.45
46 #define BOOST_FILESYSTEM_VERSION 3
47 #include "boost/filesystem.hpp"
48 
49 // -- Standard headers --
50 
51 #include <iostream>
52 
53 // == Classes ==
54 
55 class Tempfile
56 {
57  public:
58  Tempfile();
59  ~Tempfile();
60 
61  // Returns the name of the temporary file.
62  // Under Windows the pathnames are wide-char.
63 #ifdef _WIN32
64  const wchar_t*
65 #else
66  const char*
67 #endif
68  name() const { return _path.native().c_str(); }
69 
70  // print the contents of the temp file to /outs/
71  std::ostream& print(std::ostream& outs = std::cout) const;
72 
73  private:
74  boost::filesystem::path _path;
75 };
76 
77 #endif // MULTOVL_TEST_TEMPFILE_HEADER
78 
Definition: tempfile.hh:55