Skip to content

refactor: consolidate string utilities on sstr and remove legacy SStr#325

Open
plexoos wants to merge 3 commits into
mainfrom
refactor-sstr
Open

refactor: consolidate string utilities on sstr and remove legacy SStr#325
plexoos wants to merge 3 commits into
mainfrom
refactor-sstr

Conversation

@plexoos
Copy link
Copy Markdown
Member

@plexoos plexoos commented May 11, 2026

This branch removes the parallel SStr/sstr string utility split and standardizes the codebase on
sstr plus straightforward standard C++ helpers where custom wrappers were no longer needed.

The goal is to reduce duplication, shrink the maintenance surface, and make string/path/env handling
easier to follow and evolve. SStr and sstr had overlapping responsibilities, which made it
unclear which API should be preferred and kept legacy patterns alive longer than necessary.

This refactor migrates the remaining SStr call sites to sstr, spath, ssys, and simple
std::string/stream-based code, then removes the obsolete SStr implementation, tests, and build
references. The result is a smaller and more consistent utility layer with no intended functional
change.

This branch removes the parallel `SStr`/`sstr` string utility split and standardizes the codebase on
`sstr` plus straightforward standard C++ helpers where custom wrappers were no longer needed.

The goal is to reduce duplication, shrink the maintenance surface, and make string/path/env handling
easier to follow and evolve. `SStr` and `sstr` had overlapping responsibilities, which made it
unclear which API should be preferred and kept legacy patterns alive longer than necessary.

This refactor migrates the remaining `SStr` call sites to `sstr`, `spath`, `ssys`, and simple
`std::string`/stream-based code, then removes the obsolete `SStr` implementation, tests, and build
references. The result is a smaller and more consistent utility layer with no intended functional
change.
Copilot AI review requested due to automatic review settings May 11, 2026 19:10
@github-actions
Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v20.1.2) reports: 19 file(s) not formatted
  • CSG/CSGFoundry.cc
  • CSG/tests/CSGFoundry_getCenterExtent_Test.cc
  • CSG/tests/CSGNodeScanTest.cc
  • CSG/tests/CSGTargetTest.cc
  • CSG/tests/DemoGeo.cc
  • CSG/tests/DemoGrid.cc
  • CSGOptiX/CSGOptiX.cc
  • sysrap/SEnabled.cc
  • sysrap/SOpticks.cc
  • sysrap/SOpticksKey.cc
  • sysrap/SOpticksResource.cc
  • sysrap/SPPM.cc
  • sysrap/SPath.cc
  • sysrap/SSim.cc
  • sysrap/SSys.cc
  • sysrap/SVec.cc
  • sysrap/sstr.h
  • sysrap/tests/SPathTest.cc
  • u4/U4Material.cc

Have any feedback or feature suggestions? Share it here.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97e32aad93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sysrap/SEnabled.cc
char delim = ',' ;
std::vector<int> ivec ;
SStr::ISplit( spec, ivec, delim );
sstr::split<int>( ivec, spec, delim );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle empty tokens when parsing enabled-index specs

Switching from SStr::ISplit to sstr::split<int> changes behavior for malformed specs like "1,,3" or a trailing comma: sstr::split does iss >> v and pushes v even when extraction fails, so an empty token can append an indeterminate integer. In this constructor that can trigger the bounds assert or enable an unintended bit unpredictably; previously ISplit used atoi, which produced a deterministic 0 for empty tokens.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

@plexoos plexoos May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes the codebase on sstr/spath/ssys (and basic std::string utilities) by migrating remaining SStr call sites and removing the legacy SStr implementation and its tests/build references, reducing duplicated string utility APIs.

Changes:

  • Migrates formatting/splitting/trimming/concat usage from SStr to sstr/spath/ssys (plus small local helpers where needed).
  • Removes sysrap/SStr.* and the associated SStrTest plus build/script references.
  • Extends sysrap/sstr.h with SimpleMatch and minor modernizations (std::string_view).

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
u4/U4Material.cc Replaces SStr formatting/splitting with sstr and standard std::string helpers.
u4/U4.cc Drops legacy SStr.hh include as part of consolidation.
u4/tests/U4MaterialPropertyVectorTest.cc Removes unused SStr.hh include.
sysrap/tests/SStrTest.cc Removes legacy SStr unit test.
sysrap/tests/SPathTest.cc Switches legacy SStr usage to spath helpers in tests.
sysrap/tests/SEvtTest.cc Uses spath::Name instead of SStr::Name in test output naming.
sysrap/tests/SEvt__LoadTest.sh Removes SStr.cc from the standalone test build list.
sysrap/tests/CMakeLists.txt Removes SStrTest.cc from the test sources list.
sysrap/SVec.cc Replaces SStr::ReplaceChars dependency with a local std::string-based implementation.
sysrap/SSys.cc Replaces SStr::Concat with std::string composition for python -c execution.
sysrap/SStr.hh Removes legacy SStr header.
sysrap/sstr.h Adds SimpleMatch and modernizes internals (e.g. std::string_view).
sysrap/SStr.cc Removes legacy SStr implementation.
sysrap/SSim.cc Migrates trimming/splitting from SStr to sstr.
sysrap/SPPM.cc Migrates SStr string predicates to sstr.
sysrap/SPath.cc Removes SStr dependency by inlining equivalent formatting helpers.
sysrap/SOpticksResource.cc Migrates split/format calls from SStr to sstr.
sysrap/SOpticksKey.cc Migrates concat/split calls from SStr to sstr.
sysrap/SOpticks.cc Switches legacy save/concat usage to spath + std::string.
sysrap/SEnabled.cc Replaces SStr::ISplit with sstr::split.
sysrap/CMakeLists.txt Drops SStr sources/headers from the SysRap target.
qudarap/tests/QCKTest.cc Removes legacy SStr.hh include.
CSGOptiX/Frame.cc Uses ssys env helpers instead of SStr::GetEValue.
CSGOptiX/CSGOptiX.cc Migrates concat/contains/replace-end usage from SStr to sstr.
CSG/tests/DemoGrid.cc Replaces SStr env/grid parsing helpers with ssys/sstr and local parsing.
CSG/tests/DemoGeo.cc Replaces SStr parsing/prefix checks with sstr + local parsing.
CSG/tests/CSGTargetTest.cc Migrates split calls from SStr to sstr.
CSG/tests/CSGTargetGlobalTest.cc Removes legacy SStr.hh include.
CSG/tests/CSGNodeScanTest.cc Replaces SStr::ISplit with a local parser using sstr::split.
CSG/tests/CSGFoundry_getCenterExtent_Test.cc Migrates split calls from SStr to sstr.
CSG/CSGFoundry.cc Migrates split + simple-match usage from SStr to sstr and updates some formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sysrap/SSys.cc
Comment thread sysrap/SPath.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants