void PortableWriter::WriteString(const char* fieldName, const char* val)
 {
     if (val)
         WriteString(fieldName, val, static_cast<int32_t>(strlen(val)));
     else
         WriteNull(fieldName);
 }
Example #2
0
 void BinaryRawWriter::WriteString(const char* val)
 {
     if (val)
         WriteString(val, static_cast<int32_t>(strlen(val)));
     else
         WriteNull();
 }
Example #3
0
BOOL PhoneLogMng::DelAll()
{
	m_ObArr.RemoveAll();
	m_Cnt = 0;
	WriteNull();
	return TRUE;
}
Example #4
0
INLINE void WriteHex(Byte const * const &s, UInt32 const &len) {
	if (s == NULL) {
		WriteNull();
		return;
	}
    Write("\nLen = ");
    SByte buf[32];
    var chars = Converts::Convert(len, buf);
    Write(buf, chars);
    for(UInt32 i = 0; i < 16 - chars; ++i)
        WriteChar(' ');
    if (len == 0)
        return;
    Write("0  1  2  3  | 4  5  6  7  | 8  9  A  B  | C  D  E  F\n");
    for(UInt32 i = 0; i < len; ++i) {
        if ((i % 16) == 0) {
            if (i)
                WriteChar('\n');
            WriteHex(i);
            Write("              ");
        }
        else if (i && (i % 4 == 0))
            Write("   ");
        else WriteChar(' ');
        WriteHex(s[i]);
    }
    WriteChar('\n');
    //Write("----------------------------------+-------------+-------------+------------\n");
}
Example #5
0
INLINE void Write(Char  const * const &s,   UInt32 const &len) {
	if (s == NULL) {
		WriteNull();
		return;
	}
	for(UInt32 i = 0; i < len; ++i)
		WriteChar(s[i]);
}
Example #6
0
INLINE void Write(Char    const * const &s) {
	if (s == NULL) {
		WriteNull();
		return;
	}
    UInt32 i = 0;
    while(var c = s[i++])
        WriteChar(c);
}
Example #7
0
INLINE void Write(T const * const &in, UInt32 const &len) {
    if (in == NULL) {
		WriteNull();
		return;
	}
    Write("Count = ");
    Write(len);
    WriteChar(NewLine);
    for (UInt32 i = 0; i < len; ++i) {
        Write(in[i]);
        WriteChar(NewLine);
    }
}
Example #8
0
INLINE void Write(SByte const * const &s,   UInt32 const &len) {
	if (s == NULL) {
		WriteNull();
		return;
	}
    if (len == 0)
        return;
	Char C;
	Byte c1, c2, c3;
	UInt32 i = 0;
	do {
		c1 = (Byte)s[i++];
		if (c1 < 0x80u) C = c1;
		else if ((c1 & 0xE0u) == 0xE0u)
		{
            c2 = (Byte)s[i++];
			if (c2) {
                c3 = (Byte)s[i++];
				if (c3)
					C = ((c1 & 0x0Fu) << 12) | ((c2 & 0x3Fu) << 6) | (c3 & 0x3Fu);
				else
                    break;
            }
			else
                break;
		}
		else if ((c1 & 0xC0u) == 0xC0u) {
            c2 = (Byte)s[i++];
			if (c2)
				C = ((c1 & 0x1Fu) << 6) | (c2 & 0x3Fu);
			else
                break;
		}
		WriteChar(C);
	} while (i < len);
}
Example #9
0
template<typename T> void Write(Nullable<T>   const &nv) {
    if (nv.HasValue())
        Write(nv.Value());
    else
        WriteNull();
}