#include "cconsolestream.h"
#include "ccontenthandler.h"
using namespace P6R;
using namespace P6EXAMPLES;
namespace {
{
if(
P6SUCCEEDED(err = cpJSON->initialize(P6JSON_NOFLAGS,0))) {
}
}
return err;
}
{
if (
P6SUCCEEDED( err = cpInit->initialize( pConsole, pStr ))) {
}
}
return err;
}
{
"{\"menu\": {" \
" \"id\": \"file\"," \
" \"value\": \"File\"," \
" \"popup\": {" \
" \"menuitem\": [" \
" {\"value\": \"New\", \"onclick\": \"CreateNewDoc()\"}," \
" {\"value\": \"Open\", \"onclick\": \"OpenDoc()\"}," \
" {\"value\": \"Close\", \"onclick\": \"CloseDoc()\"}" \
" ]" \
" }," \
" \"readings\":[ -30, 44, 100.34, 3.5E4, 3.5e-4, true ]," \
" \"encoded\": \"Now is \\\\ the time \\u00D8 for all \\fgood men\" " \
"}}";
if(
P6FAILED(err = getContentHandler(pConsole, cpStr, cpContent.
addressof())))
return err;
err = cpReader->setContentHandler( cpContent );
err = cpStr->strlen( temp, 100000, &bufSize );
err = cpStream->endStream();
pConsole->
writeStdout(
"ERROR: Example failed with [ %1$ ]\n", &args[0], 1, NULL );
}
return err;
}
}
int main(int argc,char *argv[])
{
err = runJSON( cpConsole, cpDebugStream );
cpConsole->writeStdout("runDOM result: [ %1$ ]\n",&args[0],1,NULL);
cpConsole = NULL;
}
else printf("ERROR: Failed to retrieve console interface [ %x ]\n", err );
}
else printf("ERROR: Failed to initialize the loader [ %x ]\n", err );
}
else printf( "ERROR: Failed to create CConsoleStream [ %x ]\n", err );
return err;
}