|
|
|
@ -1,10 +1,10 @@ |
|
|
|
|
|
|
|
#include <fstream> |
|
|
|
#include "notebook.h" |
|
|
|
#include "notebook.h" |
|
|
|
#include "logging.h" |
|
|
|
#include "logging.h" |
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notebook::Model::Model() { |
|
|
|
Notebook::Model::Model() { |
|
|
|
cc_extension_ = ".cc"; |
|
|
|
cc_extension_ = ".cpp"; |
|
|
|
h_extension_ = ".h"; |
|
|
|
h_extension_ = ".hpp"; |
|
|
|
scrollvalue_ = 50; |
|
|
|
scrollvalue_ = 50; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -13,10 +13,10 @@ Notebook::View::View() : notebook_() { |
|
|
|
view_.set_position(120); |
|
|
|
view_.set_position(120); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Notebook::Controller::Controller(Gtk::Window* window, Keybindings::Controller& keybindings, |
|
|
|
Notebook::Controller::Controller(Gtk::Window* window, |
|
|
|
|
|
|
|
Keybindings::Controller& keybindings, |
|
|
|
Source::Config& source_cfg, |
|
|
|
Source::Config& source_cfg, |
|
|
|
Directories::Config& dir_cfg) : |
|
|
|
Directories::Config& dir_cfg) : |
|
|
|
source_config_(source_cfg), |
|
|
|
|
|
|
|
directories_(dir_cfg), |
|
|
|
directories_(dir_cfg), |
|
|
|
index_(0, 1) { |
|
|
|
index_(0, 1) { |
|
|
|
INFO("Create notebook"); |
|
|
|
INFO("Create notebook"); |
|
|
|
@ -25,12 +25,15 @@ Notebook::Controller::Controller(Gtk::Window* window, Keybindings::Controller& k |
|
|
|
refClipboard_ = Gtk::Clipboard::get(); |
|
|
|
refClipboard_ = Gtk::Clipboard::get(); |
|
|
|
ispopup = false; |
|
|
|
ispopup = false; |
|
|
|
view().pack1(directories_.widget(), true, true); |
|
|
|
view().pack1(directories_.widget(), true, true); |
|
|
|
|
|
|
|
source_config_ = source_cfg; |
|
|
|
CreateKeybindings(keybindings); |
|
|
|
CreateKeybindings(keybindings); |
|
|
|
|
|
|
|
INFO("Notebook Controller Success"); |
|
|
|
} // Constructor
|
|
|
|
} // Constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::CreateKeybindings(Keybindings::Controller |
|
|
|
void Notebook::Controller::CreateKeybindings(Keybindings::Controller |
|
|
|
&keybindings) { |
|
|
|
&keybindings) { |
|
|
|
|
|
|
|
INFO("Notebook create signal handlers"); |
|
|
|
directories().m_TreeView.signal_row_activated() |
|
|
|
directories().m_TreeView.signal_row_activated() |
|
|
|
.connect(sigc::mem_fun(*this, |
|
|
|
.connect(sigc::mem_fun(*this, |
|
|
|
&Notebook::Controller::OnDirectoryNavigation)); |
|
|
|
&Notebook::Controller::OnDirectoryNavigation)); |
|
|
|
@ -140,6 +143,7 @@ void Notebook::Controller::CreateKeybindings(Keybindings::Controller |
|
|
|
[this]() { |
|
|
|
[this]() { |
|
|
|
Search(false); |
|
|
|
Search(false); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
INFO("Notebook signal handlers sucsess"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool Notebook::Controller:: OnMouseRelease(GdkEventButton* button) { |
|
|
|
bool Notebook::Controller:: OnMouseRelease(GdkEventButton* button) { |
|
|
|
@ -155,6 +159,9 @@ bool Notebook::Controller::OnKeyRelease(GdkEventKey* key) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool Notebook::Controller::GeneratePopup(int key_id) { |
|
|
|
bool Notebook::Controller::GeneratePopup(int key_id) { |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, getting iters"); |
|
|
|
|
|
|
|
std::string path = text_vec_.at(CurrentPage())->path(); |
|
|
|
|
|
|
|
if (!LegalExtension(path.substr(path.find_last_of(".") + 1))) return false; |
|
|
|
// Get function to fill popup with suggests item vector under is for testing
|
|
|
|
// Get function to fill popup with suggests item vector under is for testing
|
|
|
|
Gtk::TextIter beg = CurrentTextView().get_buffer()->get_insert()->get_iter(); |
|
|
|
Gtk::TextIter beg = CurrentTextView().get_buffer()->get_insert()->get_iter(); |
|
|
|
Gtk::TextIter end = CurrentTextView().get_buffer()->get_insert()->get_iter(); |
|
|
|
Gtk::TextIter end = CurrentTextView().get_buffer()->get_insert()->get_iter(); |
|
|
|
@ -167,6 +174,7 @@ bool Notebook::Controller::GeneratePopup(int key_id) { |
|
|
|
end.backward_search("\"", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line) |
|
|
|
end.backward_search("\"", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line) |
|
|
|
|| |
|
|
|
|| |
|
|
|
end.backward_search("//", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line); |
|
|
|
end.backward_search("//", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line); |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, checking key_id"); |
|
|
|
if (illegal_chars) { |
|
|
|
if (illegal_chars) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -189,6 +197,7 @@ bool Notebook::Controller::GeneratePopup(int key_id) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, getting autocompletions"); |
|
|
|
std::vector<Source::AutoCompleteData> acdata; |
|
|
|
std::vector<Source::AutoCompleteData> acdata; |
|
|
|
text_vec_.at(CurrentPage())-> |
|
|
|
text_vec_.at(CurrentPage())-> |
|
|
|
GetAutoCompleteSuggestions(beg.get_line()+1, |
|
|
|
GetAutoCompleteSuggestions(beg.get_line()+1, |
|
|
|
@ -229,16 +238,19 @@ bool Notebook::Controller::GeneratePopup(int key_id) { |
|
|
|
popup_.get_vbox()->pack_start(popup_scroll_); |
|
|
|
popup_.get_vbox()->pack_start(popup_scroll_); |
|
|
|
popup_.set_transient_for(*window_); |
|
|
|
popup_.set_transient_for(*window_); |
|
|
|
popup_.show_all(); |
|
|
|
popup_.show_all(); |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, moving popup"); |
|
|
|
int popup_x = popup_.get_width(); |
|
|
|
int popup_x = popup_.get_width(); |
|
|
|
int popup_y = items.size() * 20; |
|
|
|
int popup_y = items.size() * 20; |
|
|
|
PopupSetSize(popup_scroll_, popup_x, popup_y); |
|
|
|
PopupSetSize(popup_scroll_, popup_x, popup_y); |
|
|
|
int x, y; |
|
|
|
int x, y; |
|
|
|
FindPopupPosition(CurrentTextView(), popup_x, popup_y, x, y); |
|
|
|
FindPopupPosition(CurrentTextView(), popup_x, popup_y, x, y); |
|
|
|
popup_.move(x, y+15); |
|
|
|
popup_.move(x, y+15); |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, create handler"); |
|
|
|
PopupSelectHandler(popup_, listview_, &items); |
|
|
|
PopupSelectHandler(popup_, listview_, &items); |
|
|
|
ispopup = true; |
|
|
|
ispopup = true; |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, run popup"); |
|
|
|
popup_.run(); |
|
|
|
popup_.run(); |
|
|
|
|
|
|
|
INFO("Notebook genereate popup, hide popup"); |
|
|
|
popup_.hide(); |
|
|
|
popup_.hide(); |
|
|
|
ispopup = false; |
|
|
|
ispopup = false; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
@ -261,7 +273,8 @@ bool Notebook::Controller::ScrollEventCallback(GdkEventScroll* scroll_event) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
Notebook::Controller::~Controller() { |
|
|
|
Notebook::Controller::~Controller() { |
|
|
|
for (auto &i : text_vec_) delete i; |
|
|
|
INFO("Notebook destructor"); |
|
|
|
|
|
|
|
for (auto &i : text_vec_) delete i; |
|
|
|
for (auto &i : linenumbers_vec_) delete i; |
|
|
|
for (auto &i : linenumbers_vec_) delete i; |
|
|
|
for (auto &i : editor_vec_) delete i; |
|
|
|
for (auto &i : editor_vec_) delete i; |
|
|
|
for (auto &i : scrolledtext_vec_) delete i; |
|
|
|
for (auto &i : scrolledtext_vec_) delete i; |
|
|
|
@ -276,6 +289,7 @@ Gtk::Box& Notebook::Controller::entry_view() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::OnNewPage(std::string name) { |
|
|
|
void Notebook::Controller::OnNewPage(std::string name) { |
|
|
|
|
|
|
|
INFO("Notebook Generate new page"); |
|
|
|
OnCreatePage(); |
|
|
|
OnCreatePage(); |
|
|
|
text_vec_.back()->OnNewEmptyFile(); |
|
|
|
text_vec_.back()->OnNewEmptyFile(); |
|
|
|
Notebook().append_page(*editor_vec_.back(), name); |
|
|
|
Notebook().append_page(*editor_vec_.back(), name); |
|
|
|
@ -294,6 +308,7 @@ MapBuffers(std::map<std::string, std::string> *buffers) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::OnOpenFile(std::string path) { |
|
|
|
void Notebook::Controller::OnOpenFile(std::string path) { |
|
|
|
|
|
|
|
INFO("Notebook open file"); |
|
|
|
OnCreatePage(); |
|
|
|
OnCreatePage(); |
|
|
|
text_vec_.back()->OnOpenFile(path); |
|
|
|
text_vec_.back()->OnOpenFile(path); |
|
|
|
text_vec_.back()->set_is_saved(true); |
|
|
|
text_vec_.back()->set_is_saved(true); |
|
|
|
@ -303,12 +318,11 @@ void Notebook::Controller::OnOpenFile(std::string path) { |
|
|
|
Notebook().set_current_page(Pages()-1); |
|
|
|
Notebook().set_current_page(Pages()-1); |
|
|
|
Notebook().set_focus_child(text_vec_.back()->view()); |
|
|
|
Notebook().set_focus_child(text_vec_.back()->view()); |
|
|
|
OnBufferChange(); |
|
|
|
OnBufferChange(); |
|
|
|
|
|
|
|
text_vec_.back()->set_is_changed(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::OnCreatePage() { |
|
|
|
void Notebook::Controller::OnCreatePage() { |
|
|
|
|
|
|
|
INFO("Notebook create page"); |
|
|
|
text_vec_.push_back(new Source::Controller(source_config(), this)); |
|
|
|
text_vec_.push_back(new Source::Controller(source_config(), this)); |
|
|
|
linenumbers_vec_.push_back(new Source::Controller(source_config(), this)); |
|
|
|
linenumbers_vec_.push_back(new Source::Controller(source_config(), this)); |
|
|
|
scrolledline_vec_.push_back(new Gtk::ScrolledWindow()); |
|
|
|
scrolledline_vec_.push_back(new Gtk::ScrolledWindow()); |
|
|
|
@ -329,9 +343,11 @@ void Notebook::Controller::OnCreatePage() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::OnCloseCurrentPage() { |
|
|
|
void Notebook::Controller::OnCloseCurrentPage() { |
|
|
|
// TODO(oyvang) zalox, forgi)
|
|
|
|
INFO("Notebook close page"); |
|
|
|
// Save a temp file, in case you close one you dont want to close?
|
|
|
|
|
|
|
|
if (Pages() != 0) { |
|
|
|
if (Pages() != 0) { |
|
|
|
|
|
|
|
if(text_vec_.back()->is_changed()){ |
|
|
|
|
|
|
|
AskToSaveDialog(); |
|
|
|
|
|
|
|
} |
|
|
|
int page = CurrentPage(); |
|
|
|
int page = CurrentPage(); |
|
|
|
Notebook().remove_page(page); |
|
|
|
Notebook().remove_page(page); |
|
|
|
delete text_vec_.at(page); |
|
|
|
delete text_vec_.at(page); |
|
|
|
@ -372,6 +388,7 @@ void Notebook::Controller::OnEditCut() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::string Notebook::Controller::GetCursorWord() { |
|
|
|
std::string Notebook::Controller::GetCursorWord() { |
|
|
|
|
|
|
|
INFO("Notebook get cursor word"); |
|
|
|
int page = CurrentPage(); |
|
|
|
int page = CurrentPage(); |
|
|
|
std::string word; |
|
|
|
std::string word; |
|
|
|
Gtk::TextIter start, end; |
|
|
|
Gtk::TextIter start, end; |
|
|
|
@ -399,6 +416,7 @@ void Notebook::Controller::OnEditSearch() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::Search(bool forward) { |
|
|
|
void Notebook::Controller::Search(bool forward) { |
|
|
|
|
|
|
|
INFO("Notebook search"); |
|
|
|
int page = CurrentPage(); |
|
|
|
int page = CurrentPage(); |
|
|
|
std::string search_word; |
|
|
|
std::string search_word; |
|
|
|
search_word = entry_.text(); |
|
|
|
search_word = entry_.text(); |
|
|
|
@ -456,10 +474,12 @@ void Notebook::Controller::OnBufferChange() { |
|
|
|
ScrollEventCallback(scroll); |
|
|
|
ScrollEventCallback(scroll); |
|
|
|
delete scroll; |
|
|
|
delete scroll; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
text_vec_.at(page)->set_is_changed(true); |
|
|
|
} |
|
|
|
} |
|
|
|
void Notebook::Controller |
|
|
|
void Notebook::Controller |
|
|
|
::OnDirectoryNavigation(const Gtk::TreeModel::Path& path, |
|
|
|
::OnDirectoryNavigation(const Gtk::TreeModel::Path& path, |
|
|
|
Gtk::TreeViewColumn* column) { |
|
|
|
Gtk::TreeViewColumn* column) { |
|
|
|
|
|
|
|
INFO("Notebook directory navigation"); |
|
|
|
Gtk::TreeModel::iterator iter = directories().m_refTreeModel->get_iter(path); |
|
|
|
Gtk::TreeModel::iterator iter = directories().m_refTreeModel->get_iter(path); |
|
|
|
if (iter) { |
|
|
|
if (iter) { |
|
|
|
Gtk::TreeModel::Row row = *iter; |
|
|
|
Gtk::TreeModel::Row row = *iter; |
|
|
|
@ -539,6 +559,7 @@ void Notebook::Controller::PopupSelectHandler(Gtk::Dialog &popup, |
|
|
|
void Notebook::Controller::PopupSetSize(Gtk::ScrolledWindow &scroll, |
|
|
|
void Notebook::Controller::PopupSetSize(Gtk::ScrolledWindow &scroll, |
|
|
|
int ¤t_x, |
|
|
|
int ¤t_x, |
|
|
|
int ¤t_y) { |
|
|
|
int ¤t_y) { |
|
|
|
|
|
|
|
INFO("Notebook popup set size"); |
|
|
|
int textview_x = CurrentTextView().get_width(); |
|
|
|
int textview_x = CurrentTextView().get_width(); |
|
|
|
int textview_y = 150; |
|
|
|
int textview_y = 150; |
|
|
|
bool is_never_scroll_x = true; |
|
|
|
bool is_never_scroll_x = true; |
|
|
|
@ -573,6 +594,7 @@ void Notebook::Controller::FindPopupPosition(Gtk::TextView& textview, |
|
|
|
int popup_y, |
|
|
|
int popup_y, |
|
|
|
int &x, |
|
|
|
int &x, |
|
|
|
int &y) { |
|
|
|
int &y) { |
|
|
|
|
|
|
|
INFO("Notebook popup find position"); |
|
|
|
Gdk::Rectangle temp1, temp2; |
|
|
|
Gdk::Rectangle temp1, temp2; |
|
|
|
textview.get_cursor_locations( |
|
|
|
textview.get_cursor_locations( |
|
|
|
CurrentTextView(). |
|
|
|
CurrentTextView(). |
|
|
|
@ -602,6 +624,7 @@ void Notebook::Controller::FindPopupPosition(Gtk::TextView& textview, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller:: OnSaveFile() { |
|
|
|
void Notebook::Controller:: OnSaveFile() { |
|
|
|
|
|
|
|
INFO("Notebook save file"); |
|
|
|
if (text_vec_.at(CurrentPage())->is_saved()) { |
|
|
|
if (text_vec_.at(CurrentPage())->is_saved()) { |
|
|
|
std::ofstream file; |
|
|
|
std::ofstream file; |
|
|
|
file.open (text_vec_.at(CurrentPage())->path()); |
|
|
|
file.open (text_vec_.at(CurrentPage())->path()); |
|
|
|
@ -622,16 +645,23 @@ void Notebook::Controller:: OnSaveFile() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string Notebook::Controller::OnSaveFileAs(){ |
|
|
|
std::string Notebook::Controller::OnSaveFileAs(){ |
|
|
|
Gtk::FileChooserDialog dialog("Please choose a file", |
|
|
|
INFO("Notebook save as"); |
|
|
|
|
|
|
|
Gtk::FileChooserDialog dialog("Please choose a file",
|
|
|
|
Gtk::FILE_CHOOSER_ACTION_SAVE); |
|
|
|
Gtk::FILE_CHOOSER_ACTION_SAVE); |
|
|
|
|
|
|
|
DEBUG("SET TRANSISTEN FPR"); |
|
|
|
dialog.set_transient_for(*window_); |
|
|
|
dialog.set_transient_for(*window_); |
|
|
|
dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS); |
|
|
|
dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS); |
|
|
|
dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL); |
|
|
|
dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL); |
|
|
|
dialog.add_button("_Save", Gtk::RESPONSE_OK); |
|
|
|
dialog.add_button("_Save", Gtk::RESPONSE_OK); |
|
|
|
|
|
|
|
//dialog.set_current_name("Untitled");
|
|
|
|
|
|
|
|
DEBUG("RUN DIALOG"); |
|
|
|
int result = dialog.run(); |
|
|
|
int result = dialog.run(); |
|
|
|
|
|
|
|
DEBUG("DIALOG RUNNING"); |
|
|
|
switch (result) { |
|
|
|
switch (result) { |
|
|
|
case(Gtk::RESPONSE_OK): { |
|
|
|
case(Gtk::RESPONSE_OK): { |
|
|
|
|
|
|
|
DEBUG("get_filename()"); |
|
|
|
std::string path = dialog.get_filename(); |
|
|
|
std::string path = dialog.get_filename(); |
|
|
|
|
|
|
|
DEBUG_VAR(path); |
|
|
|
unsigned pos = path.find_last_of("/\\"); |
|
|
|
unsigned pos = path.find_last_of("/\\"); |
|
|
|
std::cout << path<< std::endl; |
|
|
|
std::cout << path<< std::endl; |
|
|
|
//notebook_.OnSaveFile(path);
|
|
|
|
//notebook_.OnSaveFile(path);
|
|
|
|
@ -649,3 +679,50 @@ std::string Notebook::Controller::OnSaveFileAs(){ |
|
|
|
return ""; |
|
|
|
return ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Notebook::Controller::AskToSaveDialog() { |
|
|
|
|
|
|
|
INFO("AskToSaveDialog"); |
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: Finding file path"); |
|
|
|
|
|
|
|
Gtk::MessageDialog dialog(*window_, "Save file!", |
|
|
|
|
|
|
|
false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO); |
|
|
|
|
|
|
|
dialog.set_secondary_text( |
|
|
|
|
|
|
|
"Do you want to save: " + |
|
|
|
|
|
|
|
text_vec_.at(CurrentPage())->path()+" ?"); |
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: run dialog"); |
|
|
|
|
|
|
|
int result = dialog.run(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Handle the response:
|
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: switch response"); |
|
|
|
|
|
|
|
switch(result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case(Gtk::RESPONSE_YES): |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: save file: yes, trying to save file"); |
|
|
|
|
|
|
|
OnSaveFile(); |
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: save file: yes, saved sucess"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case(Gtk::RESPONSE_NO): |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: save file: no"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DEBUG("AskToSaveDialog: unexpected action: Default switch"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Notebook::Controller::LegalExtension(std::string e) { |
|
|
|
|
|
|
|
std::transform(e.begin(), e.end(),e.begin(), ::tolower); |
|
|
|
|
|
|
|
std::vector<std::string> extensions = |
|
|
|
|
|
|
|
source_config().extensiontable(); |
|
|
|
|
|
|
|
if (find(extensions.begin(), extensions.end(), e) != extensions.end()) { |
|
|
|
|
|
|
|
DEBUG("Legal extension"); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
DEBUG("Ilegal extension"); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|