Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
wildwoong@gmail.com committed Jan 24, 2011
1 parent 89f03b2 commit ca45f3e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Label.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Label.cpp
#include <string>
using namespace std;

#include "Label.h"

Expand Down Expand Up @@ -67,23 +69,24 @@ int Label::Write(char ch)

int Label::Write(char* pstr)
{
int count = strlen(pstr);
if(this->current == this->length)
{
this->current = this->str.Append(pstr);
this->current = this->str.Append(pstr, count);
}
else
{
this->current = this->str.Insert(this->current, pstr);
this->current = this->str.Insert(this->current, pstr, count);
}
this->length++;
this->length+=count;

return this->current;
}

int Label::Erase(int index, int count)
{
this->current = this->str.Delete(index, count);
this->length--;
this->length-=count;

return this->current;
}
Expand Down

0 comments on commit ca45f3e

Please sign in to comment.