Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:30

0001 #ifndef BOOST_ARCHIVE_TMPDIR_HPP
0002 #define BOOST_ARCHIVE_TMPDIR_HPP
0003 
0004 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // tmpdir.hpp:
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
0018 
0019 #include <cstdlib> // getenv
0020 #include <cstddef> // NULL
0021 
0022 #include <boost/config.hpp>
0023 #ifdef BOOST_NO_STDC_NAMESPACE
0024 namespace std {
0025     using ::getenv;
0026 }
0027 #endif
0028 
0029 namespace boost {
0030 namespace archive {
0031 
0032 inline const char * tmpdir(){
0033     const char *dirname;
0034     dirname = std::getenv("TMP");
0035     if(NULL == dirname)
0036         dirname = std::getenv("TMPDIR");
0037     if(NULL == dirname)
0038         dirname = std::getenv("TEMP");
0039     if(NULL == dirname){
0040         //BOOST_ASSERT(false); // no temp directory found
0041         dirname = ".";
0042     }
0043     return dirname;
0044 }
0045 
0046 } // archive
0047 } // boost
0048 
0049 #endif // BOOST_ARCHIVE_TMPDIR_HPP