Click here to Skip to main content
15,889,116 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: WSO CCC OTD 2020-12-08 - Solution Pin
yacCarsten8-Dec-20 1:42
yacCarsten8-Dec-20 1:42 
GeneralRe: WSO CCC OTD 2020-12-08 - Solution Pin
Rich Leyshon8-Dec-20 1:55
Rich Leyshon8-Dec-20 1:55 
GeneralChuck Yeager has left the building Pin
Slacker0077-Dec-20 19:35
professionalSlacker0077-Dec-20 19:35 
GeneralRe: Chuck Yeager has left the building Pin
Sandeep Mewara7-Dec-20 21:02
mveSandeep Mewara7-Dec-20 21:02 
GeneralRe: Chuck Yeager has left the building Pin
grralph18-Dec-20 0:26
grralph18-Dec-20 0:26 
GeneralRe: Chuck Yeager has left the building Pin
GuyThiebaut8-Dec-20 1:12
professionalGuyThiebaut8-Dec-20 1:12 
GeneralRe: Chuck Yeager has left the building Pin
glennPattonWork38-Dec-20 7:28
professionalglennPattonWork38-Dec-20 7:28 
GeneralGosh I'm fortunate today Pin
honey the codewitch7-Dec-20 14:16
mvahoney the codewitch7-Dec-20 14:16 
On a lark I decided to port LexContext: A Streamlined Cursor Over a Text Input[^] and part of my Json: A Fairly Powerful JSON Engine in a Small Package[^] projects to C++ to run on ESP32 devices (or any Arduino compliant device that can handle 64 bit ints I think)

Basically I didn't like the ArduinoJson package because it didn't look like it streamed very well, and that's what my library excelled at.

I love the way I wrote it. It ported seamlessly. In a few hours I have it running - not fully featured yet - but it's parsing through a 120kb JSON document 2kb at a time (max).

Sometimes I could go back in time and hug myself. And people said I reinvented the wheel! (see Newtonsoft JSON)

Edit: And it seems pretty fast!

C++
typedef JsonReader<1024*2> JsonReader2k;
// ...
File file = SD.open("/data.json", FILE_READ);
  if (!file) {
    Serial.println(F("/data.json not found or could not be opened"));
    while (true); // halt
  }
  JsonReader2k jsonReader;
  jsonReader.begin(file);
  while(jsonReader.read()) {
    switch(jsonReader.nodeType()) {
      case JsonReader2k::Value:
        Serial.print("Value ");
        Serial.println(jsonReader.rawValue());
        break;
      case JsonReader2k::Key:
        Serial.print("Key ");
        Serial.println(jsonReader.rawValue());
        break;
      case JsonReader2k::Object:
        Serial.println("Object");
        break;
      case JsonReader2k::EndObject:
        Serial.println("End Object");
        break;
      case JsonReader2k::Array:
        Serial.println("Array");
        break;
      case JsonReader2k::EndArray:
        Serial.println("End Array");
        break;
      case JsonReader2k::Error:
        Serial.println("Error!");
        break;
    }
  }
  file.close();

Real programmers use butterflies


modified 7-Dec-20 20:28pm.

GeneralRe: Gosh I'm fortunate today Pin
Super Lloyd7-Dec-20 17:01
Super Lloyd7-Dec-20 17:01 
JokeRe: Gosh I'm fortunate today PinPopular
Sander Rossel8-Dec-20 1:18
professionalSander Rossel8-Dec-20 1:18 
GeneralRe: Gosh I'm fortunate today Pin
honey the codewitch8-Dec-20 1:20
mvahoney the codewitch8-Dec-20 1:20 
GeneralRe: Gosh I'm fortunate today Pin
Sander Rossel8-Dec-20 1:22
professionalSander Rossel8-Dec-20 1:22 
GeneralRe: Gosh I'm fortunate today Pin
honey the codewitch8-Dec-20 1:23
mvahoney the codewitch8-Dec-20 1:23 
PraiseRe: Gosh I'm fortunate today Pin
Slacker0078-Dec-20 2:14
professionalSlacker0078-Dec-20 2:14 
GeneralRe: Gosh I'm fortunate today Pin
W Balboos, GHB8-Dec-20 4:04
W Balboos, GHB8-Dec-20 4:04 
GeneralRe: Gosh I'm fortunate today Pin
honey the codewitch8-Dec-20 4:07
mvahoney the codewitch8-Dec-20 4:07 
GeneralRe: Gosh I'm fortunate today Pin
W Balboos, GHB8-Dec-20 5:25
W Balboos, GHB8-Dec-20 5:25 
QuestionBREXIT Pin
5teveH7-Dec-20 5:20
5teveH7-Dec-20 5:20 
AnswerRe: BREXIT Pin
CodeWraith7-Dec-20 5:56
CodeWraith7-Dec-20 5:56 
AnswerRe: BREXIT Pin
Nelek7-Dec-20 6:36
protectorNelek7-Dec-20 6:36 
AnswerRe: BREXIT Pin
DerekT-P7-Dec-20 9:46
professionalDerekT-P7-Dec-20 9:46 
AnswerRe: BREXIT Pin
Richard MacCutchan7-Dec-20 10:15
mveRichard MacCutchan7-Dec-20 10:15 
GeneralRe: BREXIT Pin
OriginalGriff7-Dec-20 10:57
mveOriginalGriff7-Dec-20 10:57 
GeneralRe: BREXIT Pin
Greg Utas7-Dec-20 13:19
professionalGreg Utas7-Dec-20 13:19 
GeneralRe: BREXIT Pin
5teveH7-Dec-20 22:01
5teveH7-Dec-20 22:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.