mirror of https://gitlab.com/cppit/jucipp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.7 KiB
32 lines
1.7 KiB
|
11 years ago
|
#ifndef JUCI_SOURCEFILE_H_
|
||
|
|
#define JUCI_SOURCEFILE_H_
|
||
|
|
#include <vector>
|
||
|
|
#include <string>
|
||
|
|
#include <boost/filesystem.hpp>
|
||
|
11 years ago
|
#include "gtkmm.h"
|
||
|
11 years ago
|
|
||
|
|
namespace juci {
|
||
|
|
class filesystem {
|
||
|
|
public:
|
||
|
11 years ago
|
static std::string read(const std::string &path);
|
||
|
|
static std::string read(const boost::filesystem::path &path) { return read(path.string()); }
|
||
|
10 years ago
|
static int read(const std::string &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer);
|
||
|
|
static int read(const boost::filesystem::path &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { return read(path.string(), text_buffer); }
|
||
|
11 years ago
|
|
||
|
10 years ago
|
static int read_non_utf8(const std::string &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer);
|
||
|
|
static int read_non_utf8(const boost::filesystem::path &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { return read_non_utf8(path.string(), text_buffer); }
|
||
|
|
|
||
|
11 years ago
|
static std::vector<std::string> read_lines(const std::string &path);
|
||
|
|
static std::vector<std::string> read_lines(const boost::filesystem::path &path) { return read_lines(path.string()); };
|
||
|
11 years ago
|
|
||
|
11 years ago
|
static bool write(const std::string &path, const std::string &new_content);
|
||
|
|
static bool write(const boost::filesystem::path &path, const std::string &new_content) { return write(path.string(), new_content); }
|
||
|
|
static bool write(const std::string &path) { return write(path, ""); };
|
||
|
|
static bool write(const boost::filesystem::path &path) { return write(path, ""); };
|
||
|
|
static bool write(const std::string &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer);
|
||
|
10 years ago
|
static bool write(const boost::filesystem::path &path, Glib::RefPtr<Gtk::TextBuffer> text_buffer) { return write(path.string(), text_buffer); }
|
||
|
10 years ago
|
static std::string get_home_folder();
|
||
|
11 years ago
|
};
|
||
|
|
} // namepace juci
|
||
|
|
#endif // JUCI_SOURCEFILE_H_
|