Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::Rewriter Class Reference

#include <strings.hh>

Public Member Functions

 Rewriter (std::map< std::string, std::string > rewrites)
std::string operator() (std::string s)

Detailed Description

Rewrites a string given a map of replacements, applying the replacements in sorted order, only once, considering only the strings appearing in the input string in performing replacement.

  • Replacements are not performed on intermediate strings. That is, for an input "abb" with replacements {"ab" -> "ba"}, the result is "bab".
  • Transitive replacements are not performed. For example, for the input "abcde" with replacements {"a" -> "b", "b" -> "c", "e" -> "b"}, the result is "bccdb".

The documentation for this class was generated from the following files: