Ejemplo n.º 1
0
THierarchicalStorage * TConfiguration::CreateStorage(bool & SessionList)
{
  THierarchicalStorage * Result = nullptr;
  if (GetStorage() == stRegistry)
  {
    Result = new TRegistryStorage(GetRegistryStorageKey());
  }
  else
  {
    ThrowNotImplemented(3005);
    DebugAssert(false);
  }

  if ((FOptionsStorage.get() != nullptr) && (FOptionsStorage->GetCount() > 0))
  {
    if (!SessionList)
    {
//      Result = new TOptionsStorage(FOptionsStorage.get(), ConfigurationSubKey, Result);
    }
    else
    {
      // cannot reuse session list storage for configuration as for it we need
      // the option-override storage above
    }
  }
  else
  {
    // All the above stores can be reused for configuration,
    // if no options-overrides are set
    SessionList = false;
  }

  return Result;
}
Ejemplo n.º 2
0
size_t TXmlStorage::ReadBinaryData(const UnicodeString & /*Name*/,
  void * /*Buffer*/, size_t /*Size*/) const
{
  ThrowNotImplemented(3028);
  size_t Result = 0;
  return Result;
}
Ejemplo n.º 3
0
void TConfiguration::Export(const UnicodeString & /*AFileName*/)
{
  ThrowNotImplemented(3004);
  /*
  // not to "append" the export to an existing file
  if (FileExists(FileName))
  {
    DeleteFileChecked(FileName);
  }

  THierarchicalStorage * Storage = NULL;
  THierarchicalStorage * ExportStorage = NULL;
  try
  {
    ExportStorage = new TIniFileStorage(FileName);
    ExportStorage->AccessMode = smReadWrite;
    ExportStorage->Explicit = true;

    Storage = CreateConfigStorage();
    Storage->AccessMode = smRead;

    CopyData(Storage, ExportStorage);

    if (ExportStorage->OpenSubKey(ConfigurationSubKey, true))
    {
      SaveData(ExportStorage, true);
    }
  }
  __finally
  {
    delete ExportStorage;
    delete Storage;
  }

  StoredSessions->Export(FileName);
  */
}
Ejemplo n.º 4
0
void TConfiguration::Import(const UnicodeString & /*AFileName*/)
{
  ThrowNotImplemented(3005);

/*THierarchicalStorage * Storage = NULL;
  THierarchicalStorage * ImportStorage = NULL;
  try
  {
    ImportStorage = new TIniFileStorage(FileName);
    ImportStorage->AccessMode = smRead;

    Storage = CreateConfigStorage();
    Storage->AccessMode = smReadWrite;
    Storage->Explicit = true;

    CopyData(ImportStorage, Storage);

    Default();
    LoadFrom(ImportStorage);

    if (ImportStorage->OpenSubKey(Configuration->StoredSessionsSubKey, false))
    {
      StoredSessions->Clear();
      StoredSessions->DefaultSettings->Default();
      StoredSessions->Load(ImportStorage);
    }
  }
  __finally
  {
    delete ImportStorage;
    delete Storage;
  }

  // save all and explicit
  DoSave(true, true);*/
}
Ejemplo n.º 5
0
UnicodeString TConfiguration::ModuleFileName() const
{
  ThrowNotImplemented(204);
  return L"";
}
Ejemplo n.º 6
0
void TList::Sort()
{
  // if (FList.size() > 1)
    // QuickSort(FList, 0, GetCount() - 1, Compare);
  ThrowNotImplemented(15);
}
Ejemplo n.º 7
0
size_t TXmlStorage::BinaryDataSize(const UnicodeString & /*Name*/) const
{
  ThrowNotImplemented(3026);
  size_t Result = 0; // FRegistry->GetDataSize(Name);
  return Result;
}
Ejemplo n.º 8
0
void TXmlStorage::GetValueNames(TStrings * /*Strings*/) const
{
  ThrowNotImplemented(3022);
  // FRegistry->GetValueNames(Strings);
}
Ejemplo n.º 9
0
bool TXmlStorage::Copy(TXmlStorage * /*Storage*/)
{
  ThrowNotImplemented(3020);
  bool Result = false;
  return Result;
}