From 19c0866b050a022406867aa650302f4efbf8e010 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Sat, 29 Apr 2023 09:24:26 -0400 Subject: CommandOptions (#2856) * WIP CommandOptions * Fix some output issues. * Simplify word wrapping. * Add file extensions. * Change how lookup takes place. Add appendSplit functions to StringUtil. Make Categories hold the index range of their options. * Small improvement. * Lookup with partial option names. * Associate user values. * Encoding flags in the name. * Refactor setting up of command options. * Use CommandOptions in slang-options. * Remove old help text. * Cache the CommandOptions on the Session. * Range checking. Fix bug in the Options handling. * Extra checks for validity. * Get categories directly. * Slight improvements over output. * Added NameValue types. * Fix typo. Remove some now unused diagnostics. Fix diagnostic in testing, as output has changed. * Add minimal usage message. * Remove platform executable extension from diagnostics output. * Some improvements around getting names from NameValue types. * Improve some option descriptions. * Small fixes. --- source/core/slang-string-util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/core/slang-string-util.h') diff --git a/source/core/slang-string-util.h b/source/core/slang-string-util.h index b7576da1d..2293acf8d 100644 --- a/source/core/slang-string-util.h +++ b/source/core/slang-string-util.h @@ -33,6 +33,13 @@ struct StringUtil /// Splits into outSlices up to maxSlices. Returns SLANG_OK if of 'in' consumed. static SlangResult split(const UnownedStringSlice& in, char splitChar, Index maxSlices, UnownedStringSlice* outSlices, Index& outSlicesCount); + /// Split in, by specified splitChar append into slices out + /// Slices contents will directly address into in, so contents will only stay valid as long as in does. + static void appendSplit(const UnownedStringSlice& in, char splitChar, List& slicesOut); + /// Split in by the specified splitSlice + /// Slices contents will directly address into in, so contents will only stay valid as long as in does. + static void appendSplit(const UnownedStringSlice& in, const UnownedStringSlice& splitSlice, List& slicesOut); + /// Append the joining of in items, separated by 'separator' onto out static void join(const List& in, char separator, StringBuilder& out); static void join(const List& in, const UnownedStringSlice& separator, StringBuilder& out); -- cgit v1.2.3