00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "filename.h"
00020 #include "config_util.h"
00021
00022 #include <dSearchPath.h>
00023
00024 #include <stdlib.h>
00025
00026 void
00027 show_filename(const Filename &f) {
00028 nout
00029 << "get_fullpath = " << f.get_fullpath() << "\n"
00030
00031
00032
00033
00034
00035
00036
00037 << "get_dirname = " << f.get_dirname() << "\n"
00038 << "get_basename = " << f.get_basename() << "\n"
00039 << "get_fullpath_wo_extension = " << f.get_fullpath_wo_extension() << "\n"
00040 << "get_basename_wo_extension = " << f.get_basename_wo_extension() << "\n"
00041 << "get_extension = " << f.get_extension() << "\n"
00042 << "\n";
00043 }
00044
00045
00046 int
00047 main(int argc, char *argv[]) {
00048 if (argc < 2) {
00049 nout << "Specify filename on command line.\n";
00050 exit(1);
00051 }
00052
00053 Filename f(argv[1]);
00054
00055 show_filename(f);
00056
00057 if (argc >= 3) {
00058 Filename t(argv[2]);
00059 nout << "f is " << f << " exists = " << f.exists() << "\n"
00060 << "t is " << t << " exists = " << t.exists() << "\n";
00061
00062 nout << "f.compare_timestamps(t, true, true) = "
00063 << f.compare_timestamps(t, true, true) << "\n"
00064 << "f.compare_timestamps(t, true, false) = "
00065 << f.compare_timestamps(t, true, false) << "\n"
00066 << "f.compare_timestamps(t, false, true) = "
00067 << f.compare_timestamps(t, false, true) << "\n"
00068 << "f.compare_timestamps(t, false, false) = "
00069 << f.compare_timestamps(t, false, false) << "\n";
00070 }
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 return(0);
00117 }
00118
00119