mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Migration
- Migrated taskd JSON parser into task, to provide encode/decode capability to Task::composeJSON. - Migrated taskd utf8 code, replacing old unused code. - Added unit tests or JSON. - Migrated Tree updates from taskd.
This commit is contained in:
parent
2f4e0d9e17
commit
57c1983e07
13 changed files with 717 additions and 607 deletions
|
@ -26,11 +26,11 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "Nibbler.h"
|
||||
#include "rx.h"
|
||||
#include <inttypes.h>
|
||||
#include <Nibbler.h>
|
||||
#include <rx.h>
|
||||
|
||||
const char* c_digits = "0123456789";
|
||||
|
||||
|
@ -283,7 +283,7 @@ bool Nibbler::getInt (int& result)
|
|||
|
||||
if (i > mCursor)
|
||||
{
|
||||
result = atoi (mInput.substr (mCursor, i - mCursor).c_str ());
|
||||
result = strtoimax (mInput.substr (mCursor, i - mCursor).c_str (), NULL, 10);
|
||||
mCursor = i;
|
||||
return true;
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ bool Nibbler::getUnsignedInt (int& result)
|
|||
|
||||
if (i > mCursor)
|
||||
{
|
||||
result = atoi (mInput.substr (mCursor, i - mCursor).c_str ());
|
||||
result = strtoimax (mInput.substr (mCursor, i - mCursor).c_str (), NULL, 10);
|
||||
mCursor = i;
|
||||
return true;
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ bool Nibbler::getNumber (double& result)
|
|||
while (i < mLength && isdigit (mInput[i]))
|
||||
++i;
|
||||
|
||||
result = atof (mInput.substr (mCursor, i - mCursor).c_str ());
|
||||
result = strtof (mInput.substr (mCursor, i - mCursor).c_str (), NULL);
|
||||
mCursor = i;
|
||||
return true;
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ bool Nibbler::getNumber (double& result)
|
|||
return false;
|
||||
}
|
||||
|
||||
result = atof (mInput.substr (mCursor, i - mCursor).c_str ());
|
||||
result = strtof (mInput.substr (mCursor, i - mCursor).c_str (), NULL);
|
||||
mCursor = i;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue