diff --git a/src/Examples/FileExample.cpp b/src/Examples/FileExample.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e0e81ab9123cc78fca3e588f636aedb710602324 --- /dev/null +++ b/src/Examples/FileExample.cpp @@ -0,0 +1,25 @@ +#include <iostream> +#include <TNL/File.h> +#include <TNL/String.h> + +using namespace TNL; +using namespace std; + +int main() +{ + File file; + + file.open( String("new-file.tnl"), IOMode::write ); + String title("Header"); + file.write( title ); + file.close(); + + file.open( String("new-file.tnl"), IOMode::read ); + String title2; + file.read( title2, 4); + file.close(); + + if fileExists( "new-file.tnl" ) + std::remove( "new-file.tnl" ); +} + diff --git a/src/Examples/TimerExample.cpp b/src/Examples/TimerExample.cpp new file mode 100644 index 0000000000000000000000000000000000000000..772c9907bdcfdb2329c5b7ae5b56801fb7818ffc --- /dev/null +++ b/src/Examples/TimerExample.cpp @@ -0,0 +1,15 @@ +#include <iostream> +#include <TNL/Timer.h> + +using namespace TNL; +using namespace std; + +int main() +{ + Timer time; + time.start(); + time.stop(); + time.getRealTime(); + time.reset(); +} +