chromium/ui/shell_dialogs/selected_file_info.h

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_SHELL_DIALOGS_SELECTED_FILE_INFO_H_
#define UI_SHELL_DIALOGS_SELECTED_FILE_INFO_H_

#include <optional>
#include <vector>

#include "base/files/file_path.h"
#include "build/build_config.h"
#include "ui/shell_dialogs/shell_dialogs_export.h"
#include "url/gurl.h"

namespace ui {

// Struct used for returning selected file info.
struct SHELL_DIALOGS_EXPORT SelectedFileInfo {};

// Converts a list of FilePaths to a list of ui::SelectedFileInfo.
SHELL_DIALOGS_EXPORT std::vector<SelectedFileInfo>
FilePathListToSelectedFileInfoList(const std::vector<base::FilePath>& paths);

// Converts a list of ui::SelectedFileInfos to a list of FilePaths. This uses
// the path() accessor to use the `local_path` if not empty, else the
// `file_path`.
SHELL_DIALOGS_EXPORT std::vector<base::FilePath>
SelectedFileInfoListToFilePathList(const std::vector<SelectedFileInfo>& files);

}  // namespace ui

#endif  // UI_SHELL_DIALOGS_SELECTED_FILE_INFO_H_