1 // Created on: 1999-09-17
2 // Created by: Denis PASCAL
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TDocStd_PathParser.hxx>
19 #include <TCollection_ExtendedString.hxx>
21 TDocStd_PathParser::TDocStd_PathParser(const TCollection_ExtendedString& path)
27 void TDocStd_PathParser::Parse()
29 TCollection_ExtendedString temp = myPath;
30 Standard_Integer PointPosition = myPath.SearchFromEnd(TCollection_ExtendedString("."));
32 myExtension = temp.Split(PointPosition);
35 temp.Trunc(PointPosition-1);
36 Standard_Boolean isFileName = (temp.Length()) ? Standard_True : Standard_False;
37 Standard_Boolean isTrek = Standard_True;
39 PointPosition = temp.SearchFromEnd(TCollection_ExtendedString("\\"));
40 if (!(PointPosition>0))
41 PointPosition = temp.SearchFromEnd(TCollection_ExtendedString("/"));
43 myName = temp.Split(PointPosition);
47 isTrek = Standard_False;}
52 PointPosition = temp.SearchFromEnd(TCollection_ExtendedString("/"));
54 myName = temp.Split(PointPosition);
58 isTrek = Standard_False;}
64 temp.Trunc(PointPosition-1);
75 TCollection_ExtendedString TDocStd_PathParser::Extension() const
80 TCollection_ExtendedString TDocStd_PathParser::Name() const
85 TCollection_ExtendedString TDocStd_PathParser::Trek() const
90 TCollection_ExtendedString TDocStd_PathParser::Path() const
96 Standard_Integer TDocStd_PathParser::Length() const
98 return myPath.Length();