2017-06-29 09:17:47 +08:00
|
|
|
/*
|
|
|
|
ISC License
|
|
|
|
|
2020-07-13 02:03:14 +08:00
|
|
|
Copyright (c) 2020, Antonio SJ Musumeci <trapexit@spawn.link>
|
2017-06-29 09:17:47 +08:00
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2017-06-30 23:15:20 +08:00
|
|
|
#pragma once
|
2017-06-29 09:17:47 +08:00
|
|
|
|
2020-07-13 02:03:14 +08:00
|
|
|
#include "policy.hpp"
|
2020-12-20 04:06:08 +08:00
|
|
|
#include "policies.hpp"
|
2020-07-13 02:03:14 +08:00
|
|
|
#include "tofrom_string.hpp"
|
2019-01-25 20:03:46 +08:00
|
|
|
|
2020-07-13 02:03:14 +08:00
|
|
|
#include <string>
|
2017-06-29 09:17:47 +08:00
|
|
|
|
2020-12-20 04:06:08 +08:00
|
|
|
|
2020-07-13 02:03:14 +08:00
|
|
|
class MoveOnENOSPC : public ToFromString
|
2017-06-29 09:17:47 +08:00
|
|
|
{
|
2020-07-13 02:03:14 +08:00
|
|
|
public:
|
|
|
|
MoveOnENOSPC(const bool enabled_)
|
2020-12-20 04:06:08 +08:00
|
|
|
: enabled(enabled_),
|
|
|
|
policy(&Policies::Create::mfs)
|
2017-06-29 09:17:47 +08:00
|
|
|
{
|
2020-07-13 02:03:14 +08:00
|
|
|
}
|
2017-06-29 09:17:47 +08:00
|
|
|
|
2020-07-13 02:03:14 +08:00
|
|
|
public:
|
2020-12-20 04:06:08 +08:00
|
|
|
int from_string(const std::string &s) final;
|
|
|
|
std::string to_string() const final;
|
2017-06-29 09:17:47 +08:00
|
|
|
|
2020-07-13 02:03:14 +08:00
|
|
|
public:
|
|
|
|
bool enabled;
|
2020-12-20 04:06:08 +08:00
|
|
|
Policy::Create policy;
|
2020-07-13 02:03:14 +08:00
|
|
|
};
|