Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
boinc_util.cc
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 utility/boinc_util.hh
11 /// @author David Kim (dekim@u.washington.edu)
12 
13 // Unit header
15 
16 // Project headers
18 
19 // External headers: BOINC
20 #ifdef BOINC
21 //#ifdef _WIN32
22 //#include <boinc_win.h>
23 //#endif
24 #include <boinc_api.h>
25 
26 // C++ headers
27 #include <iostream>
28 
29 
30 namespace utility {
31 namespace boinc {
32 
33 /// @brief Convert logical file names to physical names
34 void
35 resolve_filename( std::string & filename )
36 {
38 
39  // first check if file exists
40  if ( !file_exists( filename ) ) return;
41  char resolved_name[ 512 ];
42  if ( ::boinc_resolve_filename( filename.c_str(), resolved_name, sizeof( resolved_name ) ) ) {
43  std::cout << "BOINC WARNING: can't resolve filename " << filename << std::endl;
44  }
45  filename = resolved_name;
46 }
47 
48 } // namespace boinc
49 } // namespace utility
50 
51 #endif
Wrappers to make BOINC work.
Platform independent operations on files (except I/O)
std::string filename(const std::string &path)
Definition: string_util.cc:373
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
bool file_exists(std::string const &path)
Does File Exist?