| 161 | } |
| 162 | |
| 163 | const char * Context::getCacheID() const |
| 164 | { |
| 165 | AutoMutex lock(getImpl()->m_resultsCacheMutex); |
| 166 | |
| 167 | if(getImpl()->m_cacheID.empty()) |
| 168 | { |
| 169 | std::ostringstream cacheid; |
| 170 | if (!getImpl()->m_searchPaths.empty()) |
| 171 | { |
| 172 | cacheid << "Search Path "; |
| 173 | for (auto & path : getImpl()->m_searchPaths) |
| 174 | { |
| 175 | cacheid << path << " "; |
| 176 | } |
| 177 | } |
| 178 | cacheid << "Working Dir " << getImpl()->m_workingDir << " "; |
| 179 | cacheid << "Environment Mode " << getImpl()->m_envmode << " "; |
| 180 | |
| 181 | for (EnvMap::const_iterator iter = getImpl()->m_envMap.begin(), |
| 182 | end = getImpl()->m_envMap.end(); |
| 183 | iter != end; ++iter) |
| 184 | { |
| 185 | cacheid << iter->first << "=" << iter->second << " "; |
| 186 | } |
| 187 | |
| 188 | std::string fullstr = cacheid.str(); |
| 189 | getImpl()->m_cacheID = CacheIDHash(fullstr.c_str(), fullstr.size()); |
| 190 | } |
| 191 | |
| 192 | return getImpl()->m_cacheID.c_str(); |
| 193 | } |
| 194 | |
| 195 | void Context::setSearchPath(const char * path) |
| 196 | { |