Changeset 10771 for code/branches/cpp11_v2/src/libraries/core/LuaState.cc
- Timestamp:
- Nov 7, 2015, 5:24:58 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/LuaState.cc
r10769 r10771 79 79 } 80 80 81 s hared_ptr<ResourceInfo> LuaState::getFileInfo(const std::string& filename)81 std::shared_ptr<ResourceInfo> LuaState::getFileInfo(const std::string& filename) 82 82 { 83 83 // Look in the current directory first 84 s hared_ptr<ResourceInfo> sourceInfo = Resource::getInfo(sourceFileInfo_->path + filename);84 std::shared_ptr<ResourceInfo> sourceInfo = Resource::getInfo(sourceFileInfo_->path + filename); 85 85 // Continue search in root directories 86 86 if (sourceInfo == nullptr && !sourceFileInfo_->path.empty()) … … 91 91 bool LuaState::includeFile(const std::string& filename) 92 92 { 93 s hared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename);93 std::shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename); 94 94 if (sourceInfo != nullptr) 95 95 return this->includeString(Resource::open(sourceInfo)->getAsString(), sourceInfo); … … 101 101 } 102 102 103 bool LuaState::includeString(const std::string& code, const s hared_ptr<ResourceInfo>& sourceFileInfo)103 bool LuaState::includeString(const std::string& code, const std::shared_ptr<ResourceInfo>& sourceFileInfo) 104 104 { 105 105 // Parse string with provided include parser (otherwise don't preparse at all) … … 131 131 bool LuaState::doFile(const std::string& filename) 132 132 { 133 s hared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename);133 std::shared_ptr<ResourceInfo> sourceInfo = this->getFileInfo(filename); 134 134 if (sourceInfo != nullptr) 135 135 return this->doString(Resource::open(sourceInfo)->getAsString(), sourceInfo); … … 141 141 } 142 142 143 bool LuaState::doString(const std::string& code, const s hared_ptr<ResourceInfo>& sourceFileInfo)143 bool LuaState::doString(const std::string& code, const std::shared_ptr<ResourceInfo>& sourceFileInfo) 144 144 { 145 145 // Save the old source file info 146 s hared_ptr<ResourceInfo> oldSourceFileInfo = sourceFileInfo_;146 std::shared_ptr<ResourceInfo> oldSourceFileInfo = sourceFileInfo_; 147 147 // Only override if sourceFileInfo provides useful information 148 148 if (sourceFileInfo != nullptr) … … 285 285 bool LuaState::fileExists(const std::string& filename) 286 286 { 287 s hared_ptr<ResourceInfo> info = this->getFileInfo(filename);287 std::shared_ptr<ResourceInfo> info = this->getFileInfo(filename); 288 288 if (info == nullptr) 289 289 return false; … … 300 300 if (it != this->sourceCodeMap_.end()) 301 301 return it->second; 302 s hared_ptr<ResourceInfo> info = Resource::getInfo(filename);302 std::shared_ptr<ResourceInfo> info = Resource::getInfo(filename); 303 303 if (info == nullptr) 304 304 return "";
Note: See TracChangeset
for help on using the changeset viewer.