mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-11 13:30:47 -04:00
Add output stream overload for file_order_mode
This commit is contained in:
parent
08c8ef52bd
commit
db449ae8d3
@ -100,6 +100,7 @@ list(
|
||||
src/dwarfs/metadata.cpp
|
||||
src/dwarfs/metadata_writer.cpp
|
||||
src/dwarfs/mmap.cpp
|
||||
src/dwarfs/options.cpp
|
||||
src/dwarfs/os_access_posix.cpp
|
||||
src/dwarfs/progress.cpp
|
||||
src/dwarfs/scanner.cpp
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace dwarfs {
|
||||
|
||||
struct block_cache_options {
|
||||
@ -31,6 +33,8 @@ struct block_cache_options {
|
||||
|
||||
enum class file_order_mode { NONE, PATH, SCRIPT, SIMILARITY };
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, file_order_mode mode);
|
||||
|
||||
struct scanner_options {
|
||||
file_order_mode file_order;
|
||||
};
|
||||
|
49
src/dwarfs/options.cpp
Normal file
49
src/dwarfs/options.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||
/**
|
||||
* \author Marcus Holland-Moritz (github@mhxnet.de)
|
||||
* \copyright Copyright (c) Marcus Holland-Moritz
|
||||
*
|
||||
* This file is part of dwarfs.
|
||||
*
|
||||
* dwarfs is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* dwarfs is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with dwarfs. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dwarfs/options.h"
|
||||
|
||||
namespace dwarfs {
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, file_order_mode mode) {
|
||||
std::string modestr{"unknown"};
|
||||
|
||||
switch (mode) {
|
||||
case file_order_mode::NONE:
|
||||
modestr = "none";
|
||||
break;
|
||||
case file_order_mode::PATH:
|
||||
modestr = "path";
|
||||
break;
|
||||
case file_order_mode::SCRIPT:
|
||||
modestr = "script";
|
||||
break;
|
||||
case file_order_mode::SIMILARITY:
|
||||
modestr = "similarity";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return os << modestr;
|
||||
}
|
||||
|
||||
} // namespace dwarfs
|
Loading…
x
Reference in New Issue
Block a user