X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Tools.cpp;h=5632155e953e3565fc9f7de2db8f5b41b00bd97a;hb=f5c7bb3100ed321392da42f61c2ab505833ec61a;hp=50a3907eb6067d327193f0947b73be880e651bfe;hpb=6a737aadaa4b1f19c7791245a0ef74a398b719a4;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp index 50a3907eb..5632155e9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp @@ -1,14 +1,16 @@ -/* - * GeomAlgoAPI_Tools.cpp - * - * Created on: May 18, 2015 - * Author: spo - */ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: GeomAlgoAPI_Tools.cpp +// Created: May 18, 2015 +// Author: Sergey POKHODENKO #include "GeomAlgoAPI_Tools.h" #include +#include +#include + using namespace GeomAlgoAPI_Tools; Localizer::Localizer() @@ -21,3 +23,24 @@ Localizer::~Localizer() { std::setlocale(LC_NUMERIC, myCurLocale.c_str()); } + + +std::string File_Tools::extension(const std::string& theFileName) +{ + // retrieve the file and plugin library names + TCollection_AsciiString aFileName(theFileName.c_str()); + OSD_Path aPath(aFileName); + TCollection_AsciiString anExtension = aPath.Extension(); + // TCollection_AsciiString are numbered from 1 + anExtension = anExtension.SubString(2, anExtension.Length()); + anExtension.UpperCase(); + return anExtension.ToCString(); +} + +std::string File_Tools::name(const std::string& theFileName) +{ + // retrieve the file and plugin library names + TCollection_AsciiString aFileName(theFileName.c_str()); + OSD_Path aPath(aFileName); + return aPath.Name().ToCString(); +}