コード例 #1
0
ファイル: OBJstream.C プロジェクト: ADGlassby/OpenFOAM-2.2.x
Foam::Ostream& Foam::OBJstream::write(const char* str)
{
    for (const char* p = str; *p != '\0'; ++p)
    {
        writeAndCheck(*p);
    }
    return *this;
}
コード例 #2
0
ファイル: WaspRFID13.cpp プロジェクト: ferrangb/waspmoteapi
    */	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);
	}
コード例 #3
0
ファイル: OBJstream.C プロジェクト: ADGlassby/OpenFOAM-2.2.x
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;
}
コード例 #4
0
ファイル: OBJstream.C プロジェクト: ADGlassby/OpenFOAM-2.2.x
Foam::Ostream& Foam::OBJstream::write(const char c)
{
    writeAndCheck(c);
    return *this;
}