Update of /cvsroot/objecthandler/ObjectHandler/ohxl
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9174/ohxl
Modified Files:
objecthandlerxl.cpp objecthandlerxl.hpp
Log Message:
case-preserving logic for object IDs
Index: objecthandlerxl.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** objecthandlerxl.cpp 29 Oct 2006 13:04:27 -0000 1.19
--- objecthandlerxl.cpp 29 Oct 2006 16:13:44 -0000 1.20
***************
*** 137,149 ****
}
}
!
! boost::shared_ptr<Object> ObjectHandlerXL::retrieveObjectImpl(const std::string &objectID) const {
! std::string objectIDStub;
int counterOffset = objectID.length() - 5;
if (counterOffset >= 0 && objectID[counterOffset] == '#')
! objectIDStub = objectID.substr(0, counterOffset);
else
! objectIDStub = objectID;
! return ObjectHandler::retrieveObjectImpl(objectIDStub);
}
--- 137,150 ----
}
}
! std::string ObjectHandlerXL::getStub(const std::string &objectID) const {
int counterOffset = objectID.length() - 5;
if (counterOffset >= 0 && objectID[counterOffset] == '#')
! return objectID.substr(0, counterOffset);
else
! return objectID;
! }
!
! boost::shared_ptr<Object> ObjectHandlerXL::retrieveObjectImpl(const std::string &objectID) const {
! return ObjectHandler::retrieveObjectImpl(getStub(objectID));
}
***************
*** 167,171 ****
}
std::ostringstream s;
! s << "OBJ_" << std::setw(COUNT_WIDTH) << std::setfill('0') << std::setbase(COUNT_BASE) << objectIDCount_++;
return s.str();
}
--- 168,172 ----
}
std::ostringstream s;
! s << "obj_" << std::setw(COUNT_WIDTH) << std::setfill('0') << std::setbase(COUNT_BASE) << objectIDCount_++;
return s.str();
}
***************
*** 192,195 ****
--- 193,200 ----
}
+ void ObjectHandlerXL::deleteObject(const std::string &objectID) {
+ ObjectHandler::deleteObject(getStub(objectID));
+ }
+
void ObjectHandlerXL::deleteAllObjects(const bool &deletePermanent) {
if (deletePermanent) {
Index: objecthandlerxl.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** objecthandlerxl.hpp 29 Oct 2006 13:04:27 -0000 1.17
--- objecthandlerxl.hpp 29 Oct 2006 16:13:44 -0000 1.18
***************
*** 59,62 ****
--- 59,63 ----
virtual boost::shared_ptr<Object> retrieveObjectImpl(const std::string &objectID) const;
virtual void collectGarbage(const bool &deletePermanent = false);
+ virtual void deleteObject(const std::string &objectID);
virtual void deleteAllObjects(const bool &deletePermanent = false);
***************
*** 78,81 ****
--- 79,83 ----
void clearCallingRange(boost::shared_ptr<CallingRange> callingRange);
static unsigned long objectIDCount_;
+ std::string getStub(const std::string &objectID) const;
};
|