コード例 #1
0
ファイル: FileReader.cpp プロジェクト: MindMil/XCSoar
const TCHAR *
DataFieldFileReader::GetItem(unsigned index) const
{
  EnsureLoadedDeconst();

  return files[index].path;
}
コード例 #2
0
ファイル: FileReader.cpp プロジェクト: pascaltempez/xcsoar
const TCHAR *
DataFieldFileReader::getItem(unsigned index) const
{
  EnsureLoadedDeconst();

  return files[index].mTextPathFile;
}
コード例 #3
0
ファイル: FileReader.cpp プロジェクト: MindMil/XCSoar
unsigned
DataFieldFileReader::size() const
{
  EnsureLoadedDeconst();

  return files.size();
}
コード例 #4
0
ファイル: FileReader.cpp プロジェクト: pascaltempez/xcsoar
int
DataFieldFileReader::GetNumFiles(void) const
{
  EnsureLoadedDeconst();

  return files.size();
}
コード例 #5
0
ファイル: File.cpp プロジェクト: ThomasXBMC/XCSoar
unsigned
FileDataField::GetNumFiles() const
{
  EnsureLoadedDeconst();

  return files.size();
}
コード例 #6
0
ファイル: FileReader.cpp プロジェクト: MindMil/XCSoar
int
DataFieldFileReader::GetAsInteger() const
{
  if (!postponed_value.empty())
    EnsureLoadedDeconst();

  return mValue;
}
コード例 #7
0
ファイル: File.cpp プロジェクト: ThomasXBMC/XCSoar
int
FileDataField::GetAsInteger() const
{
  if (!postponed_value.empty())
    EnsureLoadedDeconst();

  return current_index;
}
コード例 #8
0
ファイル: FileReader.cpp プロジェクト: pascaltempez/xcsoar
ComboList *
DataFieldFileReader::CreateComboList() const
{
  /* sorry for the const_cast .. this method keeps the promise of not
     modifying the object, given that one does not count filling the
     (cached) file list as "modification" */
  EnsureLoadedDeconst();

  ComboList *cl = new ComboList();

  TCHAR buffer[MAX_PATH];

  for (unsigned i = 0; i < files.size(); i++) {
    const TCHAR *path = files[i].mTextFile;
    if (path == NULL)
      path = _T("");

    /* is a file with the same base name present in another data
       directory? */

    bool found = false;
    for (unsigned j = 1; j < files.size(); j++) {
      if (j != i && _tcscmp(path, files[j].mTextFile) == 0) {
        found = true;
        break;
      }
    }

    if (found) {
      /* yes - append the absolute path to allow the user to see the
         difference */
      _tcscpy(buffer, path);
      _tcscat(buffer, _T(" ("));
      _tcscat(buffer, files[i].mTextPathFile);
      _tcscat(buffer, _T(")"));
      path = buffer;
    }

    cl->Append(i, path);
    if (i == mValue) {
      cl->ComboPopupItemSavedIndex = i;
    }
  }

  return cl;
}
コード例 #9
0
ファイル: File.cpp プロジェクト: ThomasXBMC/XCSoar
ComboList
FileDataField::CreateComboList(const TCHAR *reference) const
{
  /* sorry for the const_cast .. this method keeps the promise of not
     modifying the object, given that one does not count filling the
     (cached) file list as "modification" */
  EnsureLoadedDeconst();

  ComboList combo_list;

  TCHAR buffer[MAX_PATH];

  for (unsigned i = 0; i < files.size(); i++) {
    const TCHAR *path = files[i].filename;
    assert(path != nullptr);

    /* is a file with the same base name present in another data
       directory? */

    bool found = false;
    for (unsigned j = 1; j < files.size(); j++) {
      if (j != i && StringIsEqual(path, files[j].filename)) {
        found = true;
        break;
      }
    }

    if (found) {
      /* yes - append the absolute path to allow the user to see the
         difference */
      _tcscpy(buffer, path);
      _tcscat(buffer, _T(" ("));
      _tcscat(buffer, files[i].path);
      _tcscat(buffer, _T(")"));
      path = buffer;
    }

    combo_list.Append(i, path);
  }

  combo_list.current_index = current_index;

  return combo_list;
}