Alien-SmokeQt
view release on metacpan or search on metacpan
generator/parser/rpp/pp-stream.h view on Meta::CPAN
* Stream designed for character-at-a-time processing
*
* @author Hamish Rodda <rodda@kde.org>
*/
class CPPPARSER_EXPORT Stream
{
static const uint newline;
public:
Stream();
//If the given offset anchor has the member "collapsed" set to true, the position will be locked.
explicit Stream( const uint * string, uint stringSize, const Anchor& offset = Anchor(0,0), LocationTable* table = 0 );
explicit Stream( PreprocessedContents * string, const Anchor& offset = Anchor(0,0), LocationTable* table = 0 );
explicit Stream( PreprocessedContents * string, LocationTable* table );
virtual ~Stream();
bool isNull() const;
bool atEnd() const;
void toEnd();
generator/parser/rpp/pp-stream.h view on Meta::CPAN
QByteArray stringFrom(int offset) const;
/// \warning the input and output lines are not updated when calling this function.
/// if you're seek()ing over a line boundary, you'll need to fix the line and column
/// numbers.
void seek(int offset);
/// Start from the beginning again
void reset();
/// Lock/unlock the input position. If the input position is locked, it will not be moved forwards.
void lockInputPosition(bool lock);
/// If a macro-expansion is set, all anchors given to mark() will get that macro-expansion set.
/// It marks the position from where the macro-expansion was started that leads to the current output @see rpp::Anchor
void setMacroExpansion(const SimpleCursor&);
SimpleCursor macroExpansion() const;
//Checks whether the current index represents a character, and eventually compares it
bool operator==(const char otherc) const {
return isCharacter(*c) && *c == indexFromCharacter(otherc);
generator/parser/rpp/pp-stream.h view on Meta::CPAN
Stream& operator--();
///Removes the last added item from the output, and returns it
uint popLastOutput();
///Allows peeking at the items that were added to the output recently
uint peekLastOutput(uint backOffset = 0) const;
///Returns the cursor that points to the current input position.
Anchor inputPosition() const;
///If the input position is collapsed, the input position will be locked from now on. It will stay the same until a new one is set.
void setInputPosition(const Anchor& position);
///Input-position that marks the start of the topmost currently expanding macro in the original document
SimpleCursor originalInputPosition() const;
void setOriginalInputPosition(const SimpleCursor& position);
///Used for output streams to mark stream positions with input position
///The macroExpansion member may have no effect if macroExpansion is set for this stream.
void mark(const Anchor& position);
( run in 0.745 second using v1.01-cache-2.11-cpan-49f99fa48dc )