FileBuffer Class Reference
#include <filebuffer.h>
Collaboration diagram for FileBuffer:

Public Types | |
enum | ValueSetMode { VSM_RESET, VSM_APPEND, VSM_EXCLUDE } |
Public Member Functions | |
FileBuffer () | |
FileBuffer (const QString &fileName) | |
~FileBuffer () | |
Destructor. | |
void | bufferFile (const QString &fileName) |
Loads a file into the buffer. | |
void | appendBufferText (const QStringList &buffer) |
void | removeComments () |
removeComments does as name implies. | |
Caret | findInBuffer (const QString &subString, const Caret &startPos, bool nvlToMax=false, bool searchForVariable=false) |
Find next accurance of a substring in the buffer starting at a given caret position Uses searchForVariable flag to determine if we are looking for a variable (like "TARGET") or just a sign (like "="). | |
void | saveBuffer (const QString &filename, const QString &qmakeHeader="") |
Writes buffer to a file. | |
void | dumpBuffer () |
QString | pop (int row) |
Pop a line from the buffer Returns: the string being popped. | |
QStringList | popBlock (const Caret &blockStart, const Caret &blockEnd) |
QStringList | copyBlock (const Caret &blockStart, const Caret &blockEnd) |
void | setScopeName (const QString &scopeName) |
QString | getScopeName () |
QStringList | getChildScopeNames () |
bool | findNextScope (const Caret &pos, Caret &scopeStart, Caret &scopeEnd) |
Caret | findScopeEnd (Caret pos) |
bool | handleScopes () |
Handling qmake scopes means handling two types of scopes 1. | |
int | findChildBuffer (const QString &scopeName) |
void | makeScope (const QString &scopeString) |
Create a new scope triggering the creation of new subBuffers. | |
void | removeScope (const QString &scopeString, const QString &removeString, QStringList buffer=QStringList()) |
QStringList | getBufferTextInDepth () |
FileBuffer * | getSubBuffer (QString scopeString="") |
Get the subBuffer representing a certain scope (s1:s2:s3:...:sn). | |
void | splitScopeString (QString scopeString, QString &scopeName, QString &scopeRest) |
Split a scopestring (s1:s2:s3:...:sn) into scopename (s1) and scoperest (s2:s3:...:sn). | |
QStringList | getAllScopeStrings (int depth=0) |
QStringList | getAllScopeNames (int depth=0) |
void | removeValues (const QString &variable) |
Remove values for a variable. | |
bool | getValues (const QString &variable, QStringList &plusValues, QStringList &minusValues) |
Get values for a variable. | |
void | setValues (const QString &variable, QString values, FileBuffer::ValueSetMode append=VSM_APPEND, int valuesPerRow=3) |
void | setValues (const QString &variable, QStringList values, FileBuffer::ValueSetMode append=VSM_APPEND, int valuesPerRow=3) |
Set values for a variable. | |
bool | getAllExcludeValues (const QString &variable, QStringList &minusValues, int depth=0) |
void | getVariableValueSetModes (const QString &variable, QPtrList< FileBuffer::ValueSetMode > &modes) |
Get all VariableSetModes for a variable. | |
void | filterOutIgnoreValues (QString &line, QStringList &valuesignore) |
ValuesIgnore * | getValuesIgnore (const QString &variable) |
Private Attributes | |
QString | m_scopeName |
QStringList | m_buffer |
FileBufferList | m_subBuffers |
ValuesIgnoreList | m_valuesIgnore |
Member Enumeration Documentation
|
Definition at line 37 of file filebuffer.h. Referenced by getVariableValueSetModes(). |
Constructor & Destructor Documentation
|
Definition at line 39 of file filebuffer.h. Referenced by handleScopes(), and makeScope(). |
|
Definition at line 40 of file filebuffer.h. |
|
Destructor.
Definition at line 20 of file filebuffer.cpp. References m_subBuffers, and m_valuesIgnore. |
Member Function Documentation
|
Definition at line 45 of file filebuffer.h. Referenced by handleScopes(). |
|
Loads a file into the buffer.
Definition at line 419 of file filebuffer.cpp. References m_buffer, and removeComments(). Referenced by TrollProjectWidget::parse(). |
|
Definition at line 545 of file filebuffer.cpp. References m_buffer, Caret::m_idx, and Caret::m_row. Referenced by popBlock(). |
|
Definition at line 502 of file filebuffer.cpp. References m_buffer. |
|
Definition at line 763 of file filebuffer.cpp. References len. Referenced by getValues(). |
|
Definition at line 681 of file filebuffer.cpp. References m_subBuffers. Referenced by getSubBuffer(), handleScopes(), makeScope(), and removeScope(). |
|
Find next accurance of a substring in the buffer starting at a given caret position Uses searchForVariable flag to determine if we are looking for a variable (like "TARGET") or just a sign (like "="). Returns: a Caret pointing to the position where the substring is found. nvlToMax ? (rowcount+1,0) : (-1,-1) if the substring is not found. Definition at line 37 of file filebuffer.cpp. References m_buffer, Caret::m_idx, and Caret::m_row. Referenced by findNextScope(), findScopeEnd(), getValues(), getVariableValueSetModes(), handleScopes(), and removeValues(). |
|
Definition at line 533 of file filebuffer.cpp. References findInBuffer(), and findScopeEnd(). Referenced by handleScopes(). |
|
Definition at line 509 of file filebuffer.cpp. References findInBuffer(). Referenced by findNextScope(). |
|
Definition at line 743 of file filebuffer.cpp. References getScopeName(), getValues(), and m_subBuffers. |
|
Definition at line 706 of file filebuffer.cpp. References getScopeName(), and m_subBuffers. |
|
Definition at line 690 of file filebuffer.cpp. References getScopeName(), and m_subBuffers. |
|
Definition at line 486 of file filebuffer.cpp. References getScopeName(), and m_subBuffers. Referenced by saveBuffer(). |
|
Definition at line 734 of file filebuffer.cpp. References m_subBuffers. Referenced by TrollProjectWidget::parseScope(). |
|
Definition at line 56 of file filebuffer.h. Referenced by getAllExcludeValues(), getAllScopeNames(), getAllScopeStrings(), and getBufferTextInDepth(). |
|
Get the subBuffer representing a certain scope (s1:s2:s3:...:sn). Returns the subbuffer Definition at line 136 of file filebuffer.cpp. References findChildBuffer(), m_subBuffers, and splitScopeString(). Referenced by handleScopes(), TrollProjectWidget::parseScope(), and TrollProjectWidget::updateProjectFile(). |
|
Get values for a variable. Returns: values as a whitespace separated list. (value_1 value_2 ... value_n) Definition at line 249 of file filebuffer.cpp. References filterOutIgnoreValues(), findInBuffer(), getValuesIgnore(), m_buffer, Caret::m_idx, Caret::m_row, ValuesIgnore::values, and ValuesIgnore::values_exclude. Referenced by getAllExcludeValues(), TrollProjectWidget::parse(), and TrollProjectWidget::parseScope(). |
|
Definition at line 819 of file filebuffer.cpp. References m_valuesIgnore, and ValuesIgnore::variable. Referenced by getValues(), and setValues(). |
|
Get all VariableSetModes for a variable.
Definition at line 336 of file filebuffer.cpp. References findInBuffer(), m_buffer, Caret::m_idx, Caret::m_row, ValueSetMode, VSM_APPEND, VSM_EXCLUDE, and VSM_RESET. Referenced by TrollProjectWidget::parse(). |
|
Handling qmake scopes means handling two types of scopes 1. bracket scopes s1:s2:...:sn{ . . . } 2. non-bracketscopes s1:s2:...:sn:v1 = ... [\ ... [\ ...]] Definition at line 588 of file filebuffer.cpp. References appendBufferText(), FileBuffer(), findChildBuffer(), findInBuffer(), findNextScope(), getSubBuffer(), m_buffer, Caret::m_idx, Caret::m_row, m_subBuffers, makeScope(), pop(), popBlock(), and setScopeName(). Referenced by TrollProjectWidget::parse(). |
|
Create a new scope triggering the creation of new subBuffers. The method is recursive, thus the scope "n1:n2:n3" will create the subbuffer n1, and n1.makeScope is called with "n2:n3" etc. Definition at line 463 of file filebuffer.cpp. References FileBuffer(), findChildBuffer(), m_subBuffers, setScopeName(), and splitScopeString(). Referenced by handleScopes(), and TrollProjectWidget::slotCreateScope(). |
|
Pop a line from the buffer Returns: the string being popped.
Definition at line 98 of file filebuffer.cpp. References m_buffer. Referenced by handleScopes(), popBlock(), removeComments(), and removeValues(). |
|
Definition at line 558 of file filebuffer.cpp. References copyBlock(), m_buffer, Caret::m_idx, Caret::m_row, and pop(). Referenced by handleScopes(). |
|
removeComments does as name implies. For the time being this rather drastic cut into manual applied comments is inavoidable. Definition at line 78 of file filebuffer.cpp. References m_buffer, and pop(). Referenced by bufferFile(). |
|
Definition at line 832 of file filebuffer.cpp. References findChildBuffer(), m_subBuffers, and splitScopeString(). Referenced by TrollProjectWidget::slotRemoveScope(). |
|
Remove values for a variable.
Definition at line 393 of file filebuffer.cpp. References findInBuffer(), Caret::m_row, and pop(). Referenced by TrollProjectWidget::updateInstallObjects(), TrollProjectWidget::updateProjectConfiguration(), and TrollProjectWidget::updateProjectFile(). |
|
Writes buffer to a file.
Definition at line 442 of file filebuffer.cpp. References getBufferTextInDepth(), and Structure::length(). Referenced by TrollProjectWidget::updateProjectConfiguration(), and TrollProjectWidget::updateProjectFile(). |
|
Definition at line 55 of file filebuffer.h. Referenced by handleScopes(), and makeScope(). |
|
Set values for a variable. (variable = value_1 value_2 valu_3 ... value_n) Definition at line 152 of file filebuffer.cpp. References getValuesIgnore(), m_buffer, ValuesIgnore::values, and ValuesIgnore::values_exclude. |
|
Definition at line 75 of file filebuffer.h. Referenced by TrollProjectWidget::updateInstallObjects(), TrollProjectWidget::updateProjectConfiguration(), and TrollProjectWidget::updateProjectFile(). |
|
Split a scopestring (s1:s2:s3:...:sn) into scopename (s1) and scoperest (s2:s3:...:sn).
Definition at line 113 of file filebuffer.cpp. Referenced by getSubBuffer(), makeScope(), and removeScope(). |
Member Data Documentation
|
Definition at line 85 of file filebuffer.h. Referenced by bufferFile(), copyBlock(), dumpBuffer(), findInBuffer(), getValues(), getVariableValueSetModes(), handleScopes(), pop(), popBlock(), removeComments(), and setValues(). |
|
Definition at line 84 of file filebuffer.h. |
|
Definition at line 86 of file filebuffer.h. Referenced by findChildBuffer(), getAllExcludeValues(), getAllScopeNames(), getAllScopeStrings(), getBufferTextInDepth(), getChildScopeNames(), getSubBuffer(), handleScopes(), makeScope(), removeScope(), and ~FileBuffer(). |
|
Definition at line 87 of file filebuffer.h. Referenced by getValuesIgnore(), and ~FileBuffer(). |
The documentation for this class was generated from the following files:
- buildtools/qmake/filebuffer.h
- buildtools/qmake/filebuffer.cpp