Changeset 1742
- Timestamp:
- 08/11/11 10:39:23 (7 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
bindings/cpp/NeXusFile.hpp (modified) (1 diff)
-
include/napi.h (modified) (1 diff)
-
test/napi_test.c (modified) (1 diff)
-
test/napi_test_cpp.cxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bindings/cpp/NeXusFile.hpp
r1735 r1742 801 801 * \return The name of the file. 802 802 */ 803 std::string inquireFile(const int buff_length = NX_MAX NAMELEN);803 std::string inquireFile(const int buff_length = NX_MAXPATHLEN); 804 804 805 805 /** -
trunk/include/napi.h
r1738 r1742 119 119 #define NX_MAXRANK 32 120 120 #define NX_MAXNAMELEN 64 121 #define NX_MAXPATHLEN 1024 121 122 122 123 -
trunk/test/napi_test.c
r1741 r1742 36 36 static int testExternal(char *progName); 37 37 38 char *relativePathOf(const char* filename) {38 static const char *relativePathOf(const char* filename) { 39 39 char cwd[1024]; 40 char *pointer;41 40 42 41 getcwd(cwd, sizeof(cwd)); 43 42 44 if (strncmp(filename, cwd, strlen(cwd)) == 0) { 43 if (strncmp(filename, cwd, strlen(cwd)) == 0) 44 { 45 45 return filename+strlen(cwd)+1; 46 46 } 47 return filename; 47 else 48 { 49 return filename; 50 } 48 51 } 49 52 -
trunk/test/napi_test_cpp.cxx
r1741 r1742 17 17 using std::vector; 18 18 19 char *relativePathOf(std::stringfilenamestr) {19 static std::string relativePathOf(const std::string& filenamestr) { 20 20 char cwd[1024]; 21 char *filename;22 23 filename = strdup(filenamestr.c_str());24 21 25 22 getcwd(cwd, sizeof(cwd)); 26 23 27 //fprintf(stderr, "filename %s cwd %s\n", filename, cwd); 28 if (strncmp(filename, cwd, strlen(cwd)) == 0) { 29 return filename + strlen(cwd) + 1; 30 } 31 return filename; 32 } 33 34 int writeTest(const string& filename, NXaccess create_code) { 24 if ( filenamestr.compare(0, strlen(cwd), cwd) == 0 ) 25 { 26 return filenamestr.substr(strlen(cwd)+1); // +1 to skip trailing / 27 } 28 else 29 { 30 return filenamestr; 31 } 32 } 33 34 static int writeTest(const string& filename, NXaccess create_code) { 35 35 NeXus::File file(filename, create_code); 36 36 // create group
Note: See TracChangeset
for help on using the changeset viewer.
