summaryrefslogtreecommitdiff
path: root/indra/newview/llsyntaxid.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2026-04-29 14:43:08 -0700
committerRider Linden <rider@lindenlab.com>2026-04-29 14:43:08 -0700
commit84e806f71492a76ab28e049ec255df479ffbb339 (patch)
tree3e7934f174cb271fd2fa290337fc78f099cd7395 /indra/newview/llsyntaxid.cpp
parent364ff6e6d45087653a302b96ccd8c9e02db2b9d1 (diff)
Added support to jsonrpc server for the viewer based syntax cache.
Diffstat (limited to 'indra/newview/llsyntaxid.cpp')
-rw-r--r--indra/newview/llsyntaxid.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp
index 3d0a9d80b4..3e6fc2d217 100644
--- a/indra/newview/llsyntaxid.cpp
+++ b/indra/newview/llsyntaxid.cpp
@@ -506,6 +506,16 @@ void LLSyntaxDefCache::loadKeywordsIntoLLSD()
mSyntaxIDChangedSignal();
}
+std::vector<std::string> LLSyntaxDefCache::getCacheFileNames() const
+{
+ std::vector<std::string> names;
+ for (const auto& [name, path] : mFileCachePaths)
+ {
+ names.push_back(name);
+ }
+ return names;
+}
+
LLSD LLSyntaxDefCache::loadDeserializedCacheFile(const std::string& file_path)
{
std::ifstream file(file_path.c_str());
@@ -524,3 +534,32 @@ LLSD LLSyntaxDefCache::loadDeserializedCacheFile(const std::string& file_path)
return LLSD();
}
+std::string LLSyntaxDefCache::loadCacheFile(const std::string& name) const
+{
+ std::string full_path = mFileCachePaths.getPath(name);
+ if (!full_path.empty())
+ {
+ std::ifstream file(full_path.c_str());
+ if (file.good())
+ {
+ std::ostringstream ss;
+ ss << file.rdbuf();
+ return (file.good()) ? ss.str() : std::string();
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Failed to open cached file: " << full_path << LL_ENDL;
+ }
+ }
+ return std::string();
+}
+
+LLSD LLSyntaxDefCache::loadCacheFileAsLLSD(const std::string& name) const
+{
+ std::string full_path = mFileCachePaths.getPath(name);
+ if (!full_path.empty())
+ {
+ return loadDeserializedCacheFile(full_path);
+ }
+ return LLSD();
+}