#include "cconsolestream.h"
#include "cfilestream.h"
using namespace P6R;
using namespace P6EXAMPLES;
namespace {
{
if(
P6SUCCEEDED(err = cpFileInit->initialize(pszFilepath))) {
}
}
return err;
}
{
}
}
return err;
}
{
}
}
return err;
}
{
"[ \"table\", " \
" { \"class\" : \"test-table\", " \
" \"style\" : \"background-color:purple\" }, " \
" [ \"row1\", \"row1-value\" ], " \
" [ \"row2\" ], " \
" \"mixed content has text anywhere\", " \
" [ \"ro";
"w3\", { \"id\" : 2345 } ]," \
" [ \"row4\", " \
" [ \"column1\", 5 ], " \
" [ \"column2\", \"10\" ] " \
" ]," \
" \"test text\" " \
"]";
cpStr->
strlen( pJsonML1, 100000, &bufSize );
cpStr->
strlen( pJsonML2, 100000, &bufSize );
cpStream = NULL;
err = cpXPath->
eval( cpDOM, NULL, NULL, &result );
{
err = cpNode->
getName( &pString, &length );
pConsole->
writeStdout(
"getName failed [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
retval = -1;
if (0 != retval) {
pConsole->
writeStdout(
"Error: expected [ column1 ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
pConsole->
writeStdout(
"resetChild() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
pConsole->
writeStdout(
"nextChild() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
err = cpChild->
getValue( &pString, &length );
pConsole->
writeStdout(
"getValue() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
retval = -1;
if (0 != retval) {
pConsole->
writeStdout(
"Error: expected [ 5 ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
}
err = cpXPath->
eval( cpDOM, NULL, NULL, &result );
{
err = cpNode->
getName( &pString, &length );
pConsole->
writeStdout(
"getName() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
retval = -1;
if (0 != retval) {
pConsole->
writeStdout(
"Error: expected [ style ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
pConsole->
writeStdout(
"resetChild() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
pConsole->
writeStdout(
"nextChild() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
err = cpChild->
getValue( &pString, &length );
pConsole->
writeStdout(
"getValue() failed [ %1$ ]\n",&args[0],1,NULL);
return err;
}
retval = -1;
err = cpStr->
wstrncmp(
P6CTEXT(
"background-color:purple"), pString, 23, &retval );
if (0 != retval) {
pConsole->
writeStdout(
"Error: expected [ background-color:purple ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
}
pConsole->
writeStdout(
"ERROR: Example failed with [ %1$ ]\n", &args[0], 1, NULL );
}
return err;
}
}
int main(int argc,char *argv[])
{
err = runDOM( 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;
}