mirror of
https://github.com/polybar/polybar.git
synced 2026-03-10 02:08:59 +00:00
Remove unused file_ptr
This commit is contained in:
committed by
Patrick Ziegler
parent
3b6a950380
commit
fa1240f4b6
@ -17,40 +17,6 @@
|
||||
|
||||
POLYBAR_NS
|
||||
|
||||
// implementation of file_ptr {{{
|
||||
|
||||
file_ptr::file_ptr(const string& path, const string& mode) : m_path(string(path)), m_mode(string(mode)) {
|
||||
m_ptr = fopen(m_path.c_str(), m_mode.c_str());
|
||||
}
|
||||
|
||||
file_ptr::~file_ptr() {
|
||||
if (m_ptr != nullptr) {
|
||||
fclose(m_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
file_ptr::operator bool() {
|
||||
return static_cast<const file_ptr&>(*this);
|
||||
}
|
||||
file_ptr::operator bool() const {
|
||||
return m_ptr != nullptr;
|
||||
}
|
||||
|
||||
file_ptr::operator FILE*() {
|
||||
return static_cast<const file_ptr&>(*this);
|
||||
}
|
||||
file_ptr::operator FILE*() const {
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
file_ptr::operator int() {
|
||||
return static_cast<const file_ptr&>(*this);
|
||||
}
|
||||
file_ptr::operator int() const {
|
||||
return fileno(*this);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// implementation of file_descriptor {{{
|
||||
|
||||
file_descriptor::file_descriptor(const string& path, int flags, bool autoclose) : m_autoclose(autoclose) {
|
||||
|
||||
Reference in New Issue
Block a user