ecere/ide: Moved IDE's eString_PathInsideOf to ecere::com::IsPathInsideOf
authorJerome St-Louis <jerome@ecere.com>
Mon, 3 Sep 2012 22:30:22 +0000 (18:30 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 3 Sep 2012 22:30:22 +0000 (18:30 -0400)
ecere/src/com/String.ec
ide/locale/ide.pot
ide/src/debugger/Debugger.ec
ide/src/designer/CodeEditor.ec
ide/src/ide.ec
ide/src/project/Workspace.ec

index 1c18bd3..b24b15d 100644 (file)
@@ -1103,3 +1103,28 @@ public double FloatFromString(char * string)
    }
    return neg * res;
 }
+
+public bool IsPathInsideOf(char * path, char * of)
+{
+   if(!path[0] || !of[0])
+      return false;  // What to do here? Ever used?
+   else
+   {
+      char ofPart[MAX_FILENAME], ofRest[MAX_LOCATION];
+      char pathPart[MAX_FILENAME], pathRest[MAX_LOCATION];
+      strcpy(ofRest, of);
+      strcpy(pathRest, path);
+      for(; ofRest[0] && pathRest[0];)
+      {
+         SplitDirectory(ofRest, ofPart, ofRest);
+         SplitDirectory(pathRest, pathPart, pathRest);
+         if(fstrcmp(pathPart, ofPart))
+            return false;
+      }
+      if(!ofRest[0] && !pathRest[0])  // paths are identical - should return false or true? (changed to false)
+         return false;
+      else if(!pathRest[0])           // not inside of, it's the other way around
+         return false;
+      return true;
+   }
+}
index 80e995f..2b2e81b 100644 (file)
@@ -58,7 +58,7 @@ msgstr " file is not part of any project.\n"
 msgid " was "
 msgstr " was "
 
-#: ./src/debugger/Debugger.ec:818
+#: ./src/debugger/Debugger.ec:793
 msgid " with exit code %s"
 msgstr " with exit code %s"
 
@@ -74,19 +74,19 @@ msgstr "%s - %s%smakefile for %s config...\n"
 msgid "%s Compiler\n"
 msgstr "%s Compiler\n"
 
-#: ./src/debugger/Debugger.ec:2879
+#: ./src/debugger/Debugger.ec:2854
 msgid "%s Constructor, %s:%d\n"
 msgstr "%s Constructor, %s:%d\n"
 
-#: ./src/debugger/Debugger.ec:2881
+#: ./src/debugger/Debugger.ec:2856
 msgid "%s Destructor, %s:%d\n"
 msgstr "%s Destructor, %s:%d\n"
 
-#: ./src/debugger/Debugger.ec:2883
+#: ./src/debugger/Debugger.ec:2858
 msgid "%s Function, %s:%d\n"
 msgstr "%s Function, %s:%d\n"
 
-#: ./src/debugger/Debugger.ec:2875
+#: ./src/debugger/Debugger.ec:2850
 msgid "%s Method, %s:%d\n"
 msgstr "%s Method, %s:%d\n"
 
@@ -94,7 +94,7 @@ msgstr "%s Method, %s:%d\n"
 msgid "%s Project"
 msgstr "%s Project"
 
-#: ./src/debugger/Debugger.ec:2877
+#: ./src/debugger/Debugger.ec:2852
 msgid "%s Property, %s:%d\n"
 msgstr "%s Property, %s:%d\n"
 
@@ -526,7 +526,7 @@ msgstr "Copy"
 msgid "Couldn't create file."
 msgstr "Couldn't create file."
 
-#: ./src/debugger/Debugger.ec:2384
+#: ./src/debugger/Debugger.ec:2359
 msgid "Couldn't read memory"
 msgstr "Couldn't read memory"
 
@@ -556,23 +556,23 @@ msgstr "Debug Working Directory"
 msgid "Debuggable"
 msgstr "Debuggable"
 
-#: ./src/debugger/Debugger.ec:3330
+#: ./src/debugger/Debugger.ec:3305
 msgid "Debugger Error: No target process ID\n"
 msgstr "Debugger Error: No target process ID\n"
 
-#: ./src/debugger/Debugger.ec:1895
+#: ./src/debugger/Debugger.ec:1870
 msgid "Debugger Fatal Error: Couldn't get GDB process ID\n"
 msgstr "Debugger Fatal Error: Couldn't get GDB process ID\n"
 
-#: ./src/debugger/Debugger.ec:1884
+#: ./src/debugger/Debugger.ec:1859
 msgid "Debugger Fatal Error: Couldn't start GDB\n"
 msgstr "Debugger Fatal Error: Couldn't start GDB\n"
 
-#: ./src/debugger/Debugger.ec:2680
+#: ./src/debugger/Debugger.ec:2655
 msgid "Debugger Fatal Error: GDB lost\n"
 msgstr "Debugger Fatal Error: GDB lost\n"
 
-#: ./src/debugger/Debugger.ec:2307
+#: ./src/debugger/Debugger.ec:2282
 msgid "Debugger required for symbol evaluation in \"%s\""
 msgstr "Debugger required for symbol evaluation in \"%s\""
 
@@ -580,9 +580,9 @@ msgstr "Debugger required for symbol evaluation in \"%s\""
 msgid "Debugging compressed applications is not supported\n"
 msgstr "Debugging compressed applications is not supported\n"
 
-#: ./src/debugger/Debugger.ec:2000
-#: ./src/debugger/Debugger.ec:2681
-#: ./src/debugger/Debugger.ec:3347
+#: ./src/debugger/Debugger.ec:1975
+#: ./src/debugger/Debugger.ec:2656
+#: ./src/debugger/Debugger.ec:3322
 msgid "Debugging stopped\n"
 msgstr "Debugging stopped\n"
 
@@ -624,7 +624,7 @@ msgstr "Delete Folder"
 msgid "Deleting target and object files..."
 msgstr "Deleting target and object files..."
 
-#: ./src/debugger/Debugger.ec:2301
+#: ./src/debugger/Debugger.ec:2276
 msgid "Dereference failure for \"%s\""
 msgstr "Dereference failure for \"%s\""
 
@@ -694,7 +694,7 @@ msgstr "Edit"
 msgid "Editor"
 msgstr "Editor"
 
-#: ./src/debugger/Debugger.ec:2380
+#: ./src/debugger/Debugger.ec:2355
 msgid "Empty string"
 msgstr "Empty string"
 
@@ -732,11 +732,11 @@ msgstr "Error opening project file"
 msgid "Error writing project file"
 msgstr "Error writing project file"
 
-#: ./src/debugger/Debugger.ec:2268
+#: ./src/debugger/Debugger.ec:2243
 msgid "Error: Struct member not found for \"%s\""
 msgstr "Error: Struct member not found for \"%s\""
 
-#: ./src/debugger/Debugger.ec:2492
+#: ./src/debugger/Debugger.ec:2467
 msgid "Evaluation failed for \"%s\" of type \"%s\""
 msgstr "Evaluation failed for \"%s\" of type \"%s\""
 
@@ -806,7 +806,7 @@ msgstr "File not in project error"
 msgid "File with same name already in project."
 msgstr "File with same name already in project."
 
-#: ./src/project/Workspace.ec:1154
+#: ./src/project/Workspace.ec:1152
 msgid "File%s not found"
 msgstr "File%s not found"
 
@@ -990,7 +990,7 @@ msgstr "Include Files"
 msgid "Include Subdirectories"
 msgstr "Include Subdirectories"
 
-#: ./src/debugger/Debugger.ec:2310
+#: ./src/debugger/Debugger.ec:2285
 msgid "Incorrect debugger state for symbol evaluation in \"%s\""
 msgstr "Incorrect debugger state for symbol evaluation in \"%s\""
 
@@ -1006,22 +1006,22 @@ msgstr "Initializing Debugger"
 msgid "Intermediate Objects Directory"
 msgstr "Intermediate Objects Directory"
 
-#: ./src/debugger/Debugger.ec:2402
+#: ./src/debugger/Debugger.ec:2377
 msgid "Invalid Enum Value"
 msgstr "Invalid Enum Value"
 
-#: ./src/debugger/Debugger.ec:1119
-#: ./src/debugger/Debugger.ec:1135
-#: ./src/debugger/Debugger.ec:1148
-#: ./src/debugger/Debugger.ec:1253
+#: ./src/debugger/Debugger.ec:1094
+#: ./src/debugger/Debugger.ec:1110
+#: ./src/debugger/Debugger.ec:1123
+#: ./src/debugger/Debugger.ec:1228
 msgid "Invalid Source Directory"
 msgstr "Invalid Source Directory"
 
-#: ./src/debugger/Debugger.ec:2464
+#: ./src/debugger/Debugger.ec:2439
 msgid "Invalid Unicode Keypoint (0x%08X)"
 msgstr "Invalid Unicode Keypoint (0x%08X)"
 
-#: ./src/debugger/Debugger.ec:2499
+#: ./src/debugger/Debugger.ec:2474
 msgid "Invalid expression: \"%s\""
 msgstr "Invalid expression: \"%s\""
 
@@ -1092,11 +1092,11 @@ msgstr "Makefile doesn't exist. "
 msgid "Match case"
 msgstr "Match case"
 
-#: ./src/debugger/Debugger.ec:2288
+#: ./src/debugger/Debugger.ec:2263
 msgid "Member \"%s\" not found in class \"%s\""
 msgstr "Member \"%s\" not found in class \"%s\""
 
-#: ./src/debugger/Debugger.ec:2298
+#: ./src/debugger/Debugger.ec:2273
 msgid "Memory can't be read at %s"
 msgstr "Memory can't be read at %s"
 
@@ -1137,7 +1137,7 @@ msgstr "Microsoft Visual Studio 2010 (10.0) Compiler"
 msgid "Misc"
 msgstr "Misc"
 
-#: ./src/debugger/Debugger.ec:2490
+#: ./src/debugger/Debugger.ec:2465
 msgid "Missing property evaluation support for \"%s\""
 msgstr "Missing property evaluation support for \"%s\""
 
@@ -1210,11 +1210,11 @@ msgstr "Next"
 msgid "No Line Numbers"
 msgstr "No Line Numbers"
 
-#: ./src/debugger/Debugger.ec:1258
+#: ./src/debugger/Debugger.ec:1233
 msgid "No Source Directory Provided"
 msgstr "No Source Directory Provided"
 
-#: ./src/debugger/Debugger.ec:2093
+#: ./src/debugger/Debugger.ec:2068
 msgid "No source file found for selected frame"
 msgstr "No source file found for selected frame"
 
@@ -1231,11 +1231,11 @@ msgstr "Normal"
 msgid "Nothing to be found. Please specify at least one criteria."
 msgstr "Nothing to be found. Please specify at least one criteria."
 
-#: ./src/debugger/Debugger.ec:2345
+#: ./src/debugger/Debugger.ec:2320
 msgid "Null string"
 msgstr "Null string"
 
-#: ./src/debugger/Debugger.ec:2313
+#: ./src/debugger/Debugger.ec:2288
 msgid "Null type for \"%s\""
 msgstr "Null type for \"%s\""
 
@@ -1457,11 +1457,11 @@ msgstr "Properties.."
 msgid "Properties..."
 msgstr "Properties..."
 
-#: ./src/debugger/Debugger.ec:744
+#: ./src/debugger/Debugger.ec:719
 msgid "Provide source file location for %s"
 msgstr "Provide source file location for %s"
 
-#: ./src/debugger/Debugger.ec:1227
+#: ./src/debugger/Debugger.ec:1202
 msgid "Provide source files location directory for %s"
 msgstr "Provide source files location directory for %s"
 
@@ -1713,7 +1713,7 @@ msgstr "Sheet"
 msgid "Show line numbers in code editor"
 msgstr "Show line numbers in code editor"
 
-#: ./src/debugger/Debugger.ec:514
+#: ./src/debugger/Debugger.ec:489
 msgid "Signal received: %s - %s\n"
 msgstr "Signal received: %s - %s\n"
 
@@ -1737,10 +1737,10 @@ msgstr "Start"
 msgid "Starting Debug"
 msgstr "Starting Debug"
 
-#: ./src/debugger/Debugger.ec:891
-#: ./src/debugger/Debugger.ec:911
-#: ./src/debugger/Debugger.ec:955
-#: ./src/debugger/Debugger.ec:1840
+#: ./src/debugger/Debugger.ec:866
+#: ./src/debugger/Debugger.ec:886
+#: ./src/debugger/Debugger.ec:930
+#: ./src/debugger/Debugger.ec:1815
 msgid "Starting debug mode\n"
 msgstr "Starting debug mode\n"
 
@@ -1787,7 +1787,7 @@ msgstr "Strict Name Spaces"
 msgid "Supports forcing bit depth"
 msgstr "Supports forcing bit depth"
 
-#: ./src/debugger/Debugger.ec:2264
+#: ./src/debugger/Debugger.ec:2239
 msgid "Symbol \"%s\" not found"
 msgstr "Symbol \"%s\" not found"
 
@@ -1828,7 +1828,7 @@ msgstr "Target Type"
 msgid "Target and object files deleted\n"
 msgstr "Target and object files deleted\n"
 
-#: ./src/debugger/Debugger.ec:2739
+#: ./src/debugger/Debugger.ec:2714
 msgid "Target doesn't contain debug information!\n"
 msgstr "Target doesn't contain debug information!\n"
 
@@ -1866,24 +1866,24 @@ msgstr "The document %s was modified by another application.\nWould you like to
 msgid "The following file"
 msgstr "The following file"
 
-#: ./src/project/Workspace.ec:1155
+#: ./src/project/Workspace.ec:1153
 msgid "The following file%s could not be re-opened.%s"
 msgstr "The following file%s could not be re-opened.%s"
 
-#: ./src/debugger/Debugger.ec:861
+#: ./src/debugger/Debugger.ec:836
 msgid "The program %s has exited (gdb provided an unknown reason)%s.\n"
 msgstr "The program %s has exited (gdb provided an unknown reason)%s.\n"
 
-#: ./src/debugger/Debugger.ec:855
+#: ./src/debugger/Debugger.ec:830
 msgid "The program %s has exited normally%s.\n"
 msgstr "The program %s has exited normally%s.\n"
 
-#: ./src/debugger/Debugger.ec:859
+#: ./src/debugger/Debugger.ec:834
 msgid "The program %s has exited with a signal%s.\n"
 msgstr "The program %s has exited with a signal%s.\n"
 
-#: ./src/debugger/Debugger.ec:853
-#: ./src/debugger/Debugger.ec:857
+#: ./src/debugger/Debugger.ec:828
+#: ./src/debugger/Debugger.ec:832
 msgid "The program %s has exited%s.\n"
 msgstr "The program %s has exited%s.\n"
 
@@ -1891,7 +1891,7 @@ msgstr "The program %s has exited%s.\n"
 msgid "The project %s was modified by another application.\nWould you like to reload it and lose your changes?"
 msgstr "The project %s was modified by another application.\nWould you like to reload it and lose your changes?"
 
-#: ./src/debugger/Debugger.ec:1118
+#: ./src/debugger/Debugger.ec:1093
 msgid "This is the project directory.\nWould you like to try again?"
 msgstr "This is the project directory.\nWould you like to try again?"
 
@@ -1899,7 +1899,7 @@ msgstr "This is the project directory.\nWould you like to try again?"
 msgid "This project is already present in workspace."
 msgstr "This project is already present in workspace."
 
-#: ./src/debugger/Debugger.ec:1134
+#: ./src/debugger/Debugger.ec:1109
 msgid "This source directory is already specified.\nWould you like to try again?"
 msgstr "This source directory is already specified.\nWould you like to try again?"
 
@@ -1943,7 +1943,7 @@ msgstr "Tree:"
 msgid "Type"
 msgstr "Type"
 
-#: ./src/debugger/Debugger.ec:1147
+#: ./src/debugger/Debugger.ec:1122
 msgid "Unable to locate source file.\nWould you like to try again?"
 msgstr "Unable to locate source file.\nWould you like to try again?"
 
@@ -1952,15 +1952,15 @@ msgstr "Unable to locate source file.\nWould you like to try again?"
 msgid "Unable to open file %s\n\n"
 msgstr "Unable to open file %s\n\n"
 
-#: ./src/debugger/Debugger.ec:2304
+#: ./src/debugger/Debugger.ec:2279
 msgid "Unknown error for \"%s\""
 msgstr "Unknown error for \"%s\""
 
-#: ./src/debugger/Debugger.ec:3396
+#: ./src/debugger/Debugger.ec:3371
 msgid "Unknown output"
 msgstr "Unknown output"
 
-#: ./src/debugger/Debugger.ec:3374
+#: ./src/debugger/Debugger.ec:3349
 msgid "Unknown prompt"
 msgstr "Unknown prompt"
 
@@ -2055,11 +2055,11 @@ msgstr "Workspace"
 msgid "Workspace Files (*.ews)"
 msgstr "Workspace Files (*.ews)"
 
-#: ./src/project/Workspace.ec:1122
+#: ./src/project/Workspace.ec:1120
 msgid "Workspace Load File Error"
 msgstr "Workspace Load File Error"
 
-#: ./src/project/Workspace.ec:1122
+#: ./src/project/Workspace.ec:1120
 msgid "Workspace load file failed"
 msgstr "Workspace load file failed"
 
@@ -2083,11 +2083,11 @@ msgstr "Writing symbol loader...\n"
 msgid "You have modified projects.\nSave changes to "
 msgstr "You have modified projects.\nSave changes to "
 
-#: ./src/debugger/Debugger.ec:1257
+#: ./src/debugger/Debugger.ec:1232
 msgid "You must provide a source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 msgstr "You must provide a source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 
-#: ./src/debugger/Debugger.ec:1252
+#: ./src/debugger/Debugger.ec:1227
 msgid "You must provide a valid source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 msgstr "You must provide a valid source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 
@@ -2132,11 +2132,11 @@ msgstr "eC/C/C++ Files (*.ec, *.eh, *.c, *.cpp, *.cc, *.cxx, *.h, *.hpp, *.hh, *
 msgid "eC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)"
 msgstr "eC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)"
 
-#: ./src/debugger/Debugger.ec:3540
+#: ./src/debugger/Debugger.ec:3515
 msgid "err: Unable to create FIFO %s\n"
 msgstr "err: Unable to create FIFO %s\n"
 
-#: ./src/debugger/Debugger.ec:3541
+#: ./src/debugger/Debugger.ec:3516
 msgid "err: Unable to open FIFO %s for read\n"
 msgstr "err: Unable to open FIFO %s for read\n"
 
@@ -2158,7 +2158,7 @@ msgstr "es"
 msgid "found"
 msgstr "found"
 
-#: ./src/debugger/Debugger.ec:2893
+#: ./src/debugger/Debugger.ec:2868
 msgid "inside %s, %s\n"
 msgstr "inside %s, %s\n"
 
@@ -2187,7 +2187,7 @@ msgstr "s"
 msgid "s were "
 msgstr "s were "
 
-#: ./src/debugger/Debugger.ec:2899
+#: ./src/debugger/Debugger.ec:2874
 msgid "unknown source\n"
 msgstr "unknown source\n"
 
index 844bd8c..62ca984 100644 (file)
@@ -21,31 +21,6 @@ extern char * strrchr(char * s, char c);
 #endif
 #undef uint
 
-//bool eString_PathInsidePath(char * to, char * path)
-bool eString_PathInsideOf(char * path, char * of)
-{
-   if(!path[0] || !of[0])
-      return false;  // What to do here? Ever used?
-   else
-   {
-      char ofPart[MAX_FILENAME], ofRest[MAX_LOCATION];
-      char pathPart[MAX_FILENAME], pathRest[MAX_LOCATION];
-      strcpy(ofRest, of);
-      strcpy(pathRest, path);
-      for(; ofRest[0] && pathRest[0];)
-      {
-         SplitDirectory(ofRest, ofPart, ofRest);      
-         SplitDirectory(pathRest, pathPart, pathRest);
-         if(fstrcmp(pathPart, ofPart))
-            return false;
-      }
-      if(!ofRest[0] && !pathRest[0])  // paths are identical - should return false or true? (changed to false)
-         return false;
-      else if(!pathRest[0])           // not inside of, it's the other way around
-         return false;
-      return true;
-   }
-}
 
 public char * StripQuotes2(char * string, char * output)
 {
@@ -1210,7 +1185,7 @@ class Debugger
       else
       {
          // FIXED: This is how it should have been... Source locations are only for files not in project
-         // if(eString_PathInsideOf(absolutePath, ide.workspace.projectDir))
+         // if(IsPathInsideOf(absolutePath, ide.workspace.projectDir))
          //   MakePathRelative(absolutePath, ide.workspace.projectDir, relativePath);
          bool result = false;
          if(prj)
@@ -1230,7 +1205,7 @@ class Debugger
                String srcDir = null;
                for(dir : ide.workspace.sourceDirs)
                {
-                  if(eString_PathInsideOf(absolutePath, dir))
+                  if(IsPathInsideOf(absolutePath, dir))
                   {
                      MakePathRelative(absoluteFilePath, dir, relativePath);
                      srcDir = dir;
@@ -1242,7 +1217,7 @@ class Debugger
                
                if(SourceDirDialog(title, directory, null, sourceDir))
                {
-                  if(eString_PathInsideOf(absolutePath, sourceDir))
+                  if(IsPathInsideOf(absolutePath, sourceDir))
                   {
                      AddSourceDir(sourceDir);
                      MakePathRelative(absoluteFilePath, sourceDir, relativePath);
index b07d2c3..362313c 100644 (file)
@@ -1949,7 +1949,7 @@ class CodeEditor : Window
                {
                   for(p : ide.workspace.projects)
                   {
-                     if(eString_PathInsideOf(fileName, p.topNode.path))
+                     if(IsPathInsideOf(fileName, p.topNode.path))
                      {
                         prj = p;
                         break;
index 560e6be..d86f722 100644 (file)
@@ -439,7 +439,7 @@ class IDEWorkSpace : Window
                {
                   for(p : ide.workspace.projects)
                   {
-                     if(eString_PathInsideOf(debugger.activeFrame.absoluteFile, p.topNode.path))
+                     if(IsPathInsideOf(debugger.activeFrame.absoluteFile, p.topNode.path))
                      {
                         prj = p;
                         break;
index 49d08aa..017247d 100644 (file)
@@ -1,7 +1,5 @@
 import "ide"
 
-//bool eString_PathInsideOf(char * path, char * of);
-
 /*static void ParseListValue(List<String> list, char * equal)
 {
    char * start, * comma;
@@ -302,7 +300,7 @@ public:
                char * location;
                char chr[2];
                char relativePath[MAX_LOCATION];
-               if(eString_PathInsideOf(ofi.path, workspaceDir))
+               if(IsPathInsideOf(ofi.path, workspaceDir))
                {
                   MakePathRelative(ofi.path, workspaceDir, relativePath);
                   MakeSlashPath(relativePath);
@@ -377,7 +375,7 @@ public:
 
    char * GetPathWorkspaceRelativeOrAbsolute(char * path)
    {
-      if(eString_PathInsideOf(path, workspaceDir))
+      if(IsPathInsideOf(path, workspaceDir))
       {
          char relativePath[MAX_LOCATION];
          MakePathRelative(path, workspaceDir, relativePath);
@@ -624,7 +622,7 @@ public:
                bool found = false;
                for(dir : sourceDirs)
                {
-                  if(eString_PathInsideOf(bp.absoluteFilePath, dir))
+                  if(IsPathInsideOf(bp.absoluteFilePath, dir))
                   {
                      found = true;
                      break;