Exemplo n.º 1
0
Foam::Ostream& Foam::OBJstream::write(const char* str)
{
    for (const char* p = str; *p != '\0'; ++p)
    {
        writeAndCheck(*p);
    }
    return *this;
}
Exemplo n.º 2
0
    */	uint8_t WaspRFID::writeAndCheckWithAuth(uint8_t *UID, uint8_t *keyAccess , uint8_t *data , uint8_t address)
	{
		_UID[0] = UID[0]; 	_UID[2] = UID[2];
		_UID[1] = UID[1];	_UID[3] = UID[3];
		
		authenticate(UID, address , keyAccess);
		return writeAndCheck(data, address);
	}
Exemplo n.º 3
0
Foam::Ostream& Foam::OBJstream::writeQuoted
(
    const std::string& str,
    const bool quoted
)
{
    if (quoted)
    {
        OFstream::write(token::BEGIN_STRING);

        register int backslash = 0;
        for
        (
            string::const_iterator iter = str.begin();
            iter != str.end();
            ++iter
        )
        {
            register char c = *iter;

            if (c == '\\')
            {
                backslash++;
                // suppress output until we know if other characters follow
                continue;
            }
            else if (c == token::NL)
            {
                lineNumber_++;
                backslash++;    // backslash escape for newline
            }
            else if (c == token::END_STRING)
            {
                backslash++;    // backslash escape for quote
            }

            // output pending backslashes
            while (backslash)
            {
                OFstream::write('\\');
                backslash--;
            }

            writeAndCheck(c);
        }

        // silently drop any trailing backslashes
        // they would otherwise appear like an escaped end-quote
        OFstream::write(token::END_STRING);
    }
    else
    {
        // output unquoted string, only advance line number on newline
        write(str.c_str());
    }

    return *this;
}
Exemplo n.º 4
0
Foam::Ostream& Foam::OBJstream::write(const char c)
{
    writeAndCheck(c);
    return *this;
}