//********************************************************************** // SetCSVFilenameHook() // // Applications can use this to set a function that will // massage CSV filenames. //********************************************************************** // Override CSV file search method. // // CSVFileOverride The pointer to a function which will return the // full path for a given filename. // // This function allows an application to override how the GTIFGetDefn() and // related function find the CSV (Comma Separated Value) values required. // The pfnHook argument should be a pointer to a function that will take in a // CSV filename and return a full path to the file. The returned string should // be to an internal static buffer so that the caller doesn't have to free the result. // // <b>Example:</b> // // The listgeo utility uses the following override function if the user // specified a CSV file directory with the -t commandline switch (argument // put into CSVDirName). // // ... // SetCSVFilenameHook(CSVFileOverride); // ... // // static string CSVFileOverride(string pszInput) // { // #ifdef WIN32 // return CSVDirName+'\\'+pszInput; // #else // return CSVDirName+'/'+pszInput; // #endif // } public static void SetCSVFilenameHook(CSVFilenameHookFunc newHook) { CSVFilenameHook=newHook; }
//********************************************************************** // SetCSVFilenameHook() // // Applications can use this to set a function that will // massage CSV filenames. //********************************************************************** // Override CSV file search method. // // CSVFileOverride The pointer to a function which will return the // full path for a given filename. // // This function allows an application to override how the GTIFGetDefn() and // related function find the CSV (Comma Separated Value) values required. // The pfnHook argument should be a pointer to a function that will take in a // CSV filename and return a full path to the file. The returned string should // be to an internal static buffer so that the caller doesn't have to free the result. // // <b>Example:</b> // // The listgeo utility uses the following override function if the user // specified a CSV file directory with the -t commandline switch (argument // put into CSVDirName). // // ... // SetCSVFilenameHook(CSVFileOverride); // ... // // static string CSVFileOverride(string pszInput) // { // #ifdef WIN32 // return CSVDirName+'\\'+pszInput; // #else // return CSVDirName+'/'+pszInput; // #endif // } public static void SetCSVFilenameHook(CSVFilenameHookFunc newHook) { CSVFilenameHook = newHook; }