diff options
author | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
commit | 6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26 (patch) | |
tree | 1b7bd89fdcfd01715713d8a15db471dc75a96bbf /2.3-1/macros/GeneralFunctions/ConvertPathMat2C.sci | |
download | Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.tar.gz Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.tar.bz2 Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.zip |
Original Version
Diffstat (limited to '2.3-1/macros/GeneralFunctions/ConvertPathMat2C.sci')
-rw-r--r-- | 2.3-1/macros/GeneralFunctions/ConvertPathMat2C.sci | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/2.3-1/macros/GeneralFunctions/ConvertPathMat2C.sci b/2.3-1/macros/GeneralFunctions/ConvertPathMat2C.sci new file mode 100644 index 00000000..d73d22c7 --- /dev/null +++ b/2.3-1/macros/GeneralFunctions/ConvertPathMat2C.sci @@ -0,0 +1,61 @@ +function OutPath = ConvertPathMat2C(InPath,CPathStyle)
+// function OutPath = ConvertPathMat2C(InPath,CPathStyle)
+// -----------------------------------------------------------------
+// #RNU_RES_B
+// Converts the input path InPath into a path by using the path
+// style specified by CPathStyle.
+// #RNU_RES_E
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 26-Jan-2008 -- Nutricato Raffaele: Author.
+//
+// Copyright 2007 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),2,2);
+if (CPathStyle == 'windows')
+ OutPath=strsubst(InPath,'/','\');
+elseif (CPathStyle == 'unix')
+ OutPath=strsubst(InPath,'\','/');
+elseif (CPathStyle == 'cygwin')
+ OutPath=strsubst(InPath,'\','/');
+ OutPath=strsubst(OutPath,'A:','/cygdrive/a');
+ OutPath=strsubst(OutPath,'B:','/cygdrive/b');
+ OutPath=strsubst(OutPath,'C:','/cygdrive/c');
+ OutPath=strsubst(OutPath,'D:','/cygdrive/d');
+ OutPath=strsubst(OutPath,'E:','/cygdrive/e');
+ OutPath=strsubst(OutPath,'F:','/cygdrive/f');
+ OutPath=strsubst(OutPath,'G:','/cygdrive/g');
+ OutPath=strsubst(OutPath,'H:','/cygdrive/h');
+ OutPath=strsubst(OutPath,'I:','/cygdrive/i');
+ OutPath=strsubst(OutPath,'J:','/cygdrive/j');
+ OutPath=strsubst(OutPath,'K:','/cygdrive/k');
+ OutPath=strsubst(OutPath,'L:','/cygdrive/l');
+ OutPath=strsubst(OutPath,'M:','/cygdrive/m');
+ OutPath=strsubst(OutPath,'N:','/cygdrive/n');
+ OutPath=strsubst(OutPath,'O:','/cygdrive/o');
+ OutPath=strsubst(OutPath,'P:','/cygdrive/p');
+ OutPath=strsubst(OutPath,'Q:','/cygdrive/q');
+ OutPath=strsubst(OutPath,'R:','/cygdrive/r');
+ OutPath=strsubst(OutPath,'S:','/cygdrive/s');
+ OutPath=strsubst(OutPath,'T:','/cygdrive/t');
+ OutPath=strsubst(OutPath,'U:','/cygdrive/u');
+ OutPath=strsubst(OutPath,'V:','/cygdrive/v');
+ OutPath=strsubst(OutPath,'W:','/cygdrive/w');
+ OutPath=strsubst(OutPath,'X:','/cygdrive/x');
+ OutPath=strsubst(OutPath,'Y:','/cygdrive/y');
+ OutPath=strsubst(OutPath,'Z:','/cygdrive/z');
+else
+ OutPath = InPath;
+end
+endfunction
|