CSSJanus
Convert CSS stylesheets between left-to-right and right-to-left.
Loading...
Searching...
No Matches
CSSJanusTokenizer Class Reference

Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused. More...

Public Member Functions

 __construct ( $regex, $token)
 Constructor.
 
 tokenize ( $str)
 Replace all occurrences of $regex in $str with a token and remember the original strings.
 
 detokenize ( $str)
 Replace tokens with their originals.
 

Detailed Description

Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused.

Constructor & Destructor Documentation

◆ __construct()

CSSJanusTokenizer::__construct (   $regex,
  $token 
)

Constructor.

Parameters
string$regexRegular expression whose matches to replace by a token.
string$tokenToken

Member Function Documentation

◆ detokenize()

CSSJanusTokenizer::detokenize (   $str)

Replace tokens with their originals.

If multiple strings were tokenized, it's important they be detokenized in exactly the SAME ORDER.

Parameters
string$strpreviously run through tokenize()
Returns
string Original string

◆ tokenize()

CSSJanusTokenizer::tokenize (   $str)

Replace all occurrences of $regex in $str with a token and remember the original strings.

Parameters
string$strto tokenize
Returns
string Tokenized string

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