PeriDyno 1.0.0
Loading...
Searching...
No Matches
FilePath.h
Go to the documentation of this file.
1#pragma once
2
3#include <ghc/fs_std.hpp>
4
5namespace dyno
6{
7 class FilePath
8 {
9 public:
10 FilePath(std::string s = "")
11 {
12 fs_path = s;
13 }
14
15 //return the full string of the path
16 const std::string string() { return fs_path.string(); }
17 fs::path& path() { return fs_path; }
18
19 inline bool operator== (const std::string& s) const {
20 return fs_path == s;
21 }
22
23 inline bool operator!= (const std::string& s) const {
24 return fs_path != s;
25 }
26
27 bool is_path() { return _is_path; }
28
29 std::vector<std::string>& extensions() { return exts; }
30
31 void add_extension(const std::string ext) { exts.push_back(ext); }
32
33 void set_as_path(bool b) { _is_path = b; }
34
35 void set_path(std::string s) { fs_path = s; }
36
37 private:
38 bool _is_path = false;
39
40 fs::path fs_path;
41 std::vector<std::string> exts;
42 };
43}
44
45#include "FilePath.inl"
bool operator!=(const std::string &s) const
Definition FilePath.h:23
fs::path fs_path
Definition FilePath.h:40
std::vector< std::string > exts
Definition FilePath.h:41
std::vector< std::string > & extensions()
Definition FilePath.h:29
const std::string string()
Definition FilePath.h:16
fs::path & path()
Definition FilePath.h:17
bool is_path()
Definition FilePath.h:27
bool operator==(const std::string &s) const
Definition FilePath.h:19
FilePath(std::string s="")
Definition FilePath.h:10
void set_as_path(bool b)
Definition FilePath.h:33
void add_extension(const std::string ext)
Definition FilePath.h:31
void set_path(std::string s)
Definition FilePath.h:35
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25