mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-07-02 14:04:22 +00:00
New ContentType task.
Fix the problems I encountered while trying to use the new task.
This commit is contained in:
parent
b357bfb2cc
commit
c068f93bac
7 changed files with 99 additions and 5 deletions
48
include/dindexer-machinery/scantask/contenttype.hpp
Normal file
48
include/dindexer-machinery/scantask/contenttype.hpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
/* Copyright 2015, 2016, Michele Santullo
|
||||
* This file is part of "dindexer".
|
||||
*
|
||||
* "dindexer" 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.
|
||||
*
|
||||
* "dindexer" 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 "dindexer". If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef id148DBED10A0B45238E810683656BA7D5
|
||||
#define id148DBED10A0B45238E810683656BA7D5
|
||||
|
||||
#include "dindexer-machinery/scantask/base.hpp"
|
||||
#include "dindexer-machinery/guess_content_type.hpp"
|
||||
#include "dindexer-machinery/mediatypes.hpp"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace mchlib {
|
||||
struct FileRecordData;
|
||||
|
||||
namespace scantask {
|
||||
class ContentType : public Base<mchlib::ContentTypes> {
|
||||
public:
|
||||
using DirTreeTaskPtr = std::shared_ptr<Base<std::vector<FileRecordData>>>;
|
||||
using MediaTypeTaskPtr = std::shared_ptr<Base<mchlib::MediaTypes>>;
|
||||
|
||||
ContentType ( DirTreeTaskPtr parDirTree, MediaTypeTaskPtr parMediaType );
|
||||
|
||||
private:
|
||||
virtual void on_data_destroy ( mchlib::ContentTypes& parData ) override;
|
||||
virtual void on_data_create ( mchlib::ContentTypes& parData ) override;
|
||||
|
||||
DirTreeTaskPtr m_dir_tree;
|
||||
MediaTypeTaskPtr m_media_type;
|
||||
};
|
||||
} //namespace scantask
|
||||
} //namespace mchlib
|
||||
|
||||
#endif
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace mchlib {
|
||||
namespace scantask {
|
||||
class MediaType : Base<MediaTypes> {
|
||||
class MediaType : public Base<mchlib::MediaTypes> {
|
||||
public:
|
||||
MediaType ( char parDefault, bool parForce, std::string parSearchPath );
|
||||
virtual ~MediaType ( void ) noexcept = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue