#include #include #include // For system independent path support #include #include #include // For basename and extension namespace bf = boost::filesystem; #include #include "boost/date_time/gregorian/gregorian.hpp" namespace bg = boost::gregorian; int main( int argc, char *argv[] ) { bf::path test; try { test = "mplab"; test = bf::path( ".mplab", bf::native ); // needs to be native or it will throw an exception test = bf::path( "~/Temp/.mplab", bf::native ); // needs to be native or it will throw an exception } catch( const std::exception &error ) { std::cerr << error.what() << std::endl; } if( !bf::exists( test ) ) std::cout << "Path does not exist: " << test.native_file_string() << std::endl; bg::date today = bg::day_clock::local_day(); bg::date notadate; if( notadate.is_not_a_date() ) std::cout << notadate << " is not a date." << std::endl; if( today > notadate ) std::cout << "today is > notadate." << std::endl; if( today > notadate ) std::cout << "today is > notadate." << std::endl; if( today == notadate ) std::cout << "today == notadate." << std::endl; return 0; }