void GALGAS_char::description (C_String & ioString, const int32_t /* inIndentation */) const { ioString << "<@char:" ; if (isValid ()) { if (isprint ((int) UNICODE_VALUE (mCharValue))) { ioString << "'" ; ioString.appendUnicodeCharacter (mCharValue COMMA_HERE) ; ioString << "'" ; }else{ ioString << unicodeName (mCharValue) ; } }else{ ioString << "not built" ; } ioString << ">" ; }
void FileStream::open(const char* filename, bool write, bool append, bool exist) { mOpenResult = mFs.Connect(); if(mOpenResult != KErrNone) return; TPtrC8 namePtr(CBP filename); mFilename = HBufC8::New(namePtr.Length() + 1); if(!mFilename) { mOpenResult = KErrNoMemory; return; } mFilename->Des().Copy(namePtr); mFilename->Des().PtrZ(); //set the zero terminator, for getFilename(). TCleaner<HBufC16> unicodeName(CreateHBufC16FromDesC8LC(namePtr)); if(write) { if(append || exist) { LOG("AFO %s\n", filename); TSNR(mOpenResult = mFile.Open(mFs, *unicodeName, EFileShareExclusive | EFileWrite)); if(IS_SYMBIAN_ERROR(mOpenResult)) return; TInt offset = 0; if(append) { // TODO: set a flag so that every write goes to the end of the file, // even if you seek to another position. TSNR(mOpenResult = mFile.Seek(ESeekEnd, offset)); } } else { LOG("WFO %s\n", filename); TSNR(mOpenResult = mFile.Replace(mFs, *unicodeName, EFileShareExclusive | EFileWrite)); } } else { LOG("RFO %s\n", filename); TSNR(mOpenResult = mFile.Open(mFs, *unicodeName, EFileShareReadersOnly)); } }
GALGAS_string GALGAS_char::getter_unicodeName (UNUSED_LOCATION_ARGS) const { return GALGAS_string (unicodeName (mCharValue)) ; }