Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
open.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file basic/database/open.hh
11 /// @brief Functions for opening database files
12 /// @author Stuart G. Mentzer (Stuart_Mentzer@objexx.com)
13 
14 
15 #ifndef INCLUDED_basic_database_open_hh
16 #define INCLUDED_basic_database_open_hh
17 
18 
19 // Utility headers
21 
22 // C++ headers
23 #ifdef WIN32
24 #include <string>
25 #else
26 #include <iosfwd>
27 #endif
28 
29 namespace basic {
30 namespace database {
31 
32 /// @brief Does a database file exist?
33 /* Undefinded, commenting out to fix PyRosetta build
34 bool
35 exists(
36 std::string const & db_file
37 ); */
38 
39 /// @brief Open a database file on a provided stream
40 bool
41 open(
42  utility::io::izstream & db_stream,
43  std::string const & db_file,
44  bool warn = true
45 );
46 
47 /// @brief Full-path database file name
48 std::string
49 full_name(
50  std::string const & db_file,
51  bool warn = true
52 );
53 
54 /// @brief Does cache file (absolute path) exist?
55 /// if dir_only is true, will return true if the cache file could be created.
56 bool
58  std::string const & cache_file,
59  bool dir_only
60 );
61 
62 /// @brief Get the (absolute) path to a given cached file.
63 /// If source_file is given, it's the full path to the source database file that's being cached.
64 /// If for_writing is true, will only check that the given file would be creatable.
65 /// Will return an empty string if it can't find a cache file.
66 std::string
68  std::string const & short_name,
69  std::string const & source_file,
70  bool for_writing
71 );
72 
73 } // namespace database
74 } // namespace basic
75 
76 
77 #endif // INCLUDED_basic_io_database_open_HH
std::string full_name(std::string const &db_file, bool warn)
Full-path database file name.
Definition: open.cc:95
bool find_cache_file(std::string const &cache_file, bool dir_only)
Does cache file (absolute path) exist? if dir_only is true, will return true if the cache file could ...
Definition: open.cc:116
std::string full_cache_name(std::string const &short_name, std::string const &source_file, bool for_writing)
Get the (absolute) path to a given cached file. If source_file is given, it's the full path to the so...
Definition: open.cc:151
tuple database
bool open(utility::io::izstream &db_stream, std::string const &db_file, bool warn)
Open a database file on a provided stream.
Definition: open.cc:55
izstream: Input file stream wrapper for uncompressed and compressed files
Definition: izstream.hh:44
utility::io::izstream forward declarations