Ejemplo n.º 1
0
TXmlStorage::~TXmlStorage()
{
  if (GetAccessMode() == smReadWrite)
  {
    WriteXml();
  }
  SAFE_DESTROY_EX(tinyxml2::XMLDocument, FXmlDoc);
}
Ejemplo n.º 2
0
bool Config::RecupConfig(const std::string& file)
{
	if(RecupXml(file) == false)
	{
		if(WriteXml(file) == false)
			return false;
		if(RecupXml(file) == false)
			return false;
	}
	return true;
}
Ejemplo n.º 3
0
void CLogFileControl::RunL()
/**
 * Main File writing pump
 * Called on write completion or Kick() by the session that accepts the data
 */
	{
#if (defined _DEBUG)
	_LIT(KPanic,"LogEng RunL()");
#endif
	__ASSERT_DEBUG(iStatus.Int() == KErrNone,User::Panic(KPanic,iStatus.Int()));
	// Check to see if this is the result of write completion
	if(iTransmitted)
		{
		// Write completed
		// Remove the buffer at the head of the queue and free it
		CLogBuffer* buffer = iQueue.First();
		iQueue.Remove(*buffer);
		delete buffer;
		}
	// Check to see if there's more on the queue
	if(!iQueue.IsEmpty())
		{
		// There is so write the head of the queue
		CLogBuffer* buffer = iQueue.First();	
		SetActive();
		// Set the flag to say we've transmitted
		iTransmitted = ETrue;

//  ------------------------------------
		if(iLogFormat==ETxt)  WriteTxt(buffer->Buf());
		else WriteXml(buffer->Buf());
		} 
	else
		{
		// Nothing on the queue
		iTransmitted = EFalse;
		// Call into the server to check if this resource can be freed
		iParent.ControlComplete(*this);
		}
	}