minor improvements
This commit is contained in:
parent
9bb3193395
commit
0074f7c352
|
@ -113,7 +113,7 @@ std::string Extension::name() const {
|
|||
std::string temp(m_extensionType.getName());
|
||||
std::string::size_type pos = temp.find_last_of(":");
|
||||
|
||||
if(pos != std::string::npos)
|
||||
if(pos != std::string::npos)
|
||||
return temp.substr(pos+1);
|
||||
else
|
||||
return std::string();
|
||||
|
|
|
@ -255,8 +255,8 @@ public:
|
|||
|
||||
/** @name Persistance */
|
||||
//@{
|
||||
virtual void extensionSave(Base::Writer&) const {};
|
||||
virtual void extensionRestore(Base::XMLReader&) {};
|
||||
virtual void extensionSave(Base::Writer&) const {}
|
||||
virtual void extensionRestore(Base::XMLReader&) {}
|
||||
//@}
|
||||
|
||||
/** @name TypeHandling */
|
||||
|
|
|
@ -83,7 +83,7 @@ bool ExtensionContainer::hasExtension(Base::Type t) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ExtensionContainer::hasExtension(std::string name) const {
|
||||
bool ExtensionContainer::hasExtension(const std::string& name) const {
|
||||
|
||||
//and for types derived from it, as they can be cast to the extension
|
||||
for(auto entry : _extensions) {
|
||||
|
@ -115,7 +115,7 @@ bool ExtensionContainer::hasExtensions() const {
|
|||
return !_extensions.empty();
|
||||
}
|
||||
|
||||
Extension* ExtensionContainer::getExtension(std::string name) {
|
||||
Extension* ExtensionContainer::getExtension(const std::string& name) {
|
||||
|
||||
//and for types derived from it, as they can be cast to the extension
|
||||
for(auto entry : _extensions) {
|
||||
|
|
|
@ -125,10 +125,10 @@ public:
|
|||
|
||||
void registerExtension(Base::Type extension, App::Extension* ext);
|
||||
bool hasExtension(Base::Type) const; //returns first of type (or derived from) and throws otherwise
|
||||
bool hasExtension(std::string name) const; //this version does not check derived classes
|
||||
bool hasExtension(const std::string& name) const; //this version does not check derived classes
|
||||
bool hasExtensions() const;
|
||||
App::Extension* getExtension(Base::Type); //returns first of type (or derived from) and throws otherwise
|
||||
App::Extension* getExtension(std::string name); //this version does not check derived classes
|
||||
App::Extension* getExtension(const std::string& name); //this version does not check derived classes
|
||||
|
||||
//returns first of type (or derived from) and throws otherwise
|
||||
template<typename ExtensionT>
|
||||
|
|
Loading…
Reference in New Issue
Block a user