From 2727876d6b5595695125ea0d9b2e9d93b4609d20 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 14 Oct 1994 17:42:00 +0000 Subject: [PATCH] Aggiunto il metodo path ai filename git-svn-id: svn://10.65.10.50/trunk@366 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/strings.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/strings.cpp b/include/strings.cpp index dd56e2f49..c73912738 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -566,6 +566,20 @@ const char* TFilename::name() const return d+1; } +// Certified 90% +const char* TFilename::path() const +{ + const char* d = strrchr(_str, '\\'); + if (d == NULL) d = strrchr(_str, '/'); + if (d == NULL) + { + d = strchr(_str, ':'); + if (d != NULL) d++; + } + if (d == NULL) spark.cut(0); + else spark.strncpy(_str, d - _str); + return spark; +} // Certified 70% const TFilename& TFilename::tempdir()