Nitro.Modifiers Class Reference

Detailed Description

Helper classes for looking for modifiers such as private var.

Static Public Member Functions

static bool Check (CodeFragment fragment, string modifier)
 Checks for a given modifier e.g. 'private' in the given fragment of code. More...
 
static void Handle (CodeFragment fragment, out bool isPublic)
 Looks for 'private' before the given fragment. If found, it's also removed. More...
 
static CodeFragment Skip (CodeFragment fragment)
 Skips over any modifiers found in the given code fragment, returning the first non-modifier fragment found. More...
 

Member Function Documentation

static bool Nitro.Modifiers.Check ( CodeFragment  fragment,
string  modifier 
)
inlinestatic

Checks for a given modifier e.g. 'private' in the given fragment of code.

Parameters
fragmentThe fragment to check.
modifierThe modifier to check for.
Returns
True if this fragment contained the given modifier. The fragment is also removed from the code.
static void Nitro.Modifiers.Handle ( CodeFragment  fragment,
out bool  isPublic 
)
inlinestatic

Looks for 'private' before the given fragment. If found, it's also removed.

Parameters
fragmentThe fragment to check before.
isPublicTrue if private was not found.
static CodeFragment Nitro.Modifiers.Skip ( CodeFragment  fragment)
inlinestatic

Skips over any modifiers found in the given code fragment, returning the first non-modifier fragment found.

Parameters
fragmentThe place to start from.
Returns
The first non-modifier fragment found. May be the given fragment if it is not a modifier.