Skip to content

Commit

Permalink
Added detach to json builder
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmauro committed Feb 18, 2023
1 parent a2a4457 commit 8bea27b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LightJSonBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ class CLightJSonBuilder : public CBaseMemObj, public CNonCopyableObj
return cStrJsonA.GetLength();
};

LPCSTR Detach()
{
LPCSTR sA;

MX_ASSERT(aNestedTypes.GetCount() == 0); //ensure is closed
sA = cStrJsonA.Detach();
Reset();
return sA;
};

//NOTE: Assume value is in UTF-8 format
static BOOL EscapeString(_Inout_ CStringA &cStrA, _In_ LPCSTR szValueA, _In_ SIZE_T nValueLen,
_In_opt_ BOOL bAppend = FALSE);
Expand Down

0 comments on commit 8bea27b

Please sign in to comment.