Skip to content

Commit

Permalink
parses through the file
Browse files Browse the repository at this point in the history
but I don't think it's stopping at each character properly.
  • Loading branch information
thistleknot committed Aug 15, 2014
1 parent 0b15281 commit 4d26a9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -34,3 +34,9 @@ Icon
# Files that might appear on external disk
.Spotlight-V100
.Trashes

diffmatchpatch.cpp
DiffMatchPatch.pro.user
diffmatchpatch.cpp
diffmatchpatch.cpp
diffmatchpatch.cpp
Expand Down
18 changes: 8 additions & 10 deletions diffmatchpatch.cpp
Expand Up @@ -271,13 +271,16 @@ void DiffMatchPatch::on_actionObjects_Read_triggered()

QString holderString = ui->plainTextEditLeft->toPlainText();

//figured since QTextStream was made for reading in text... and it worked!
QTextStream in(&holderString);

//count lines
int lineCount = 1;

int bracketCount = 0;

//thanks stack
//http://stackoverflow.com/questions/15115571/reading-a-txt-file-using-qtextstream-c
QString line = in.readLine();
while (!in.atEnd())
{
Expand All @@ -286,21 +289,16 @@ void DiffMatchPatch::on_actionObjects_Read_triggered()
//Read Character's if length !=0
int charPosition = 0;
//while (line.length())
//not going through the length of string properly...

//length I don't think is working, but my debugger isn't working.
while (charPosition <= line.length())
{
//const QChar character = QString::operator [](charPosition) line;

//const QChar character = QString::

//QChar character = line[](charPosition);

QChar character = line[charPosition];

//string conversion?
//http://qt-project.org/faq/answer/how_can_i_convert_a_qstring_to_char_and_vice_versa
//QString characterString = character.toLatin1();
char character2 = character.toLatin1();

//if (character.toLatin1() == "[")
if (character2 == '[')
{
bracketCount++;
};
Expand Down

0 comments on commit 4d26a9f

Please sign in to comment.