From: bri Date: Mon, 10 Feb 2014 13:55:36 +0000 (+0400) Subject: Light Cleaning up X-Git-Tag: Delivery_V1_0_2013_07_12~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6e2587c4b6b4a91bed436d1f3827e0662faed09c;p=tools%2Fsimanio.git Light Cleaning up --- diff --git a/src/SimanIO_Link.cxx b/src/SimanIO_Link.cxx index d460a51..dc5dfc0 100644 --- a/src/SimanIO_Link.cxx +++ b/src/SimanIO_Link.cxx @@ -140,10 +140,10 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf() string aFileName = aURL.substr(aURL.find_last_of("/\\")+1); //cout << "aURL = " << "http://" << aSimanWSHost << "/repository/" << aURL << "\n"; - string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault\\"; + string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault/"; //only for test only for WIN - replace(aURL.begin(),aURL.end(),'/','\\'); + //replace(aURL.begin(),aURL.end(),'/','\\'); //end only for test only for WIN //cout << "Path to vault" << aPathToVault + aURL << "\n"; diff --git a/src/old_CMakeLists.txt b/src/old_CMakeLists.txt deleted file mode 100644 index 2e2100f..0000000 --- a/src/old_CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(SimanSrc CXX) - -set(SimanSrc_SRCS SimanIO_Activity.cxx SimanIO_Configuration.cxx SimanIO_Document.cxx SimanIO_Link.cxx) -set(SimanSrc_HEADERS SimanIO_Activity.hxx SimanIO_Configuration.hxx SimanIO_Document.hxx SimanIO_Link.hxx) -include_directories($(PROJECT_SOURCE_DIR)) - -add_library(SimanIO SHARED ${SimanSrc_SRCS} ${SimanSrc_HEADERS}) - -install(TARGETS SimanIO DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) -install(FILES ${SimanSrc_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include) diff --git a/src/old_SimanIO_Configuration.cxx b/src/old_SimanIO_Configuration.cxx deleted file mode 100644 index d011a60..0000000 --- a/src/old_SimanIO_Configuration.cxx +++ /dev/null @@ -1,239 +0,0 @@ -#include - -#include - -// maximum length of the line in the parsed conf file -const int MAX_BUFFER_SIZE=10000; - -using namespace std; - -SimanIO_Configuration::SimanIO_Configuration() -{ -} - -///! Returns true is the given symbol is white space -static bool IsWhite(const char theSym) { - return theSym == ' ' || theSym == '\t'; -} - -///! Returns true if theLine starts with theCommand, returns in theVal rest part of the line in this case -static bool IsCommand(const char* theCommand, char* theLine, char*& theVal) { - string aLine(theLine); - char* aComPtr = (char*)theCommand; - theVal = theLine; - while(*aComPtr != 0 && *theVal != 0) { - if (IsWhite(*aComPtr)) { // skip white spaces in the command line - aComPtr++; - continue; - } - if (IsWhite(*theVal)) { // skip white spaces in the processed line - theVal++; - continue; - } - //cout<<"Compare symbols "<eof()) { - ReadLine(); - if (IsCommand("Activity ID :", myBuffer, aVal)) { - PARSE_ERROR(activityID != -1, "Duplicated activity identifier '"<eof()) { - ReadLine(); - if (IsCommand("Document ID :", myBuffer, aVal)) { - PARSE_ERROR(aDocID != -1, "Duplicated document identifier '"<eof()) { - ReadLine(); - if (IsCommand("Automatic processing :", myBuffer, aVal)) { - char* aVal2; - if (IsCommand("file-download", aVal, aVal2)) aNewFile.proc = FILE_DOWNLOAD; - else if (IsCommand("file-import", aVal, aVal2)) aNewFile.proc = FILE_IMPORT; - else PARSE_ERROR(true, "Invalid automatic processing value '"<first + 1; // take the maximum Id plus one (in map integers are ordered) - } - } - myActivities[anId] = theActivity; -} - -SimanIO_Activity& SimanIO_Configuration::GetOrCreateActivity(const int theId) -{ - if (myActivities.find(theId) == myActivities.end()) { - myActivities[theId] = SimanIO_Activity(); - } - return myActivities[theId]; -} - -void SimanIO_Configuration::ReadLine() { - if (myReuseLine) { // reuse current line - myReuseLine = false; - return; - } - do { - myF->getline(myBuffer, MAX_BUFFER_SIZE - 1); - } while(!myF->eof() && myBuffer[0] == 0); // continue if there is empty line -} - -/////////////////////////////////// iterator methods /////////////////////////// - -SimanIO_Configuration::ActivitiesIterator::ActivitiesIterator(SimanIO_Configuration& theConf) -{ - myIter = theConf.myActivities.begin(); - myEnd = theConf.myActivities.end(); -} - -void SimanIO_Configuration::ActivitiesIterator::Next() -{ - myIter++; -} - -bool SimanIO_Configuration::ActivitiesIterator::More() -{ - return myIter != myEnd; -} - -const int SimanIO_Configuration::ActivitiesIterator::ActivityId() -{ - return myIter->first; -} - -SimanIO_Activity& SimanIO_Configuration::ActivitiesIterator::Activity() -{ - return myIter->second; -}