From d631ef9518e3a38bd10949f01700cbcba306252f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 12 Apr 2023 16:24:08 -0400 Subject: Reading artifact hierarchy from file system interface (#2787) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP simplifying artifact interface. * Use ContainedKind. * Remove LazyCastableList. Use ContainedKind for find. * Remove ICastableList. * Remove need for ICastableList. * Remove IArtifactContainer. * Small fixes. * Small improvements around Artifact. * Make explicit find is for *representations* that can cast. Fix bug in handling casting in lookup. * Made associated items artifacts too. * Small fixes. * Small improvements around writing a container. * WIP artifact container format. * Make the root a special case. * Special case if the artifact doesn't have children/associated. * First pass handling of interpretting a file system into artifact hierarchy. * Explain the final structure. Make the file system available. * Remove addArtifact from IArtifact interface - means will be compatible with previous version. * Rename function to get compile result as a filesytem. --- source/core/slang-string-slice-pool.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/core') diff --git a/source/core/slang-string-slice-pool.h b/source/core/slang-string-slice-pool.h index 765119360..15d204468 100644 --- a/source/core/slang-string-slice-pool.h +++ b/source/core/slang-string-slice-pool.h @@ -64,6 +64,11 @@ public: /// Add a string Handle add(const String& string) { return add(string.getUnownedSlice()); } + /// Add and get the result as a slice + Slice addAndGetSlice(const Slice& slice) { return getSlice(add(slice)); } + Slice addAndGetSlice(const char* chars) { return getSlice(add(chars)); } + Slice addAndGetSlice(const String& string) { return getSlice(add(string)); } + /// Returns true if found bool findOrAdd(const Slice& slice, Handle& outHandle); -- cgit v1.2.3