Исправлена работы с csv файлами

pull/20/head
Igor Belitskiy 3 years ago
parent becde51838
commit 1e0028bd9e

@ -1,14 +1,14 @@
Option,Description Option;Description
quiet,Downloading without text messages quiet;Downloading without text messages
splash,Show welcome window splash;Show welcome window
noplymouth,Disable Plymouth noplymouth;Disable Plymouth
acpi=off,Disable ACPI acpi=off;Disable ACPI
noapic,Disable APIC noapic;Disable APIC
nolapic,Disable local APIC nolapic;Disable local APIC
single,Single User Mode single;Single User Mode
nomodeset,Disable kernel selection and loading of video drivers nomodeset;Disable kernel selection and loading of video drivers
915.enable_dc=0,Disable GPU power management 915.enable_dc=0;Disable GPU power management
ahci.mobile_lpm_policy=1,"Maximum performance, power management" ahci.mobile_lpm_policy=1;Maximum performance, power management
snd-intel-dspcfg.dsp_driver=1,Forced selection of an Intel sound device driver snd-intel-dspcfg.dsp_driver=1;Forced selection of an Intel sound device driver
intel_idle.max_cstate=1,Prevents the processor from going into a deep sleep state intel_idle.max_cstate=1;Prevents the processor from going into a deep sleep state
intel_idle.max_cstate=4,Eliminates flickering laptop display on Ultra Voltage processors intel_idle.max_cstate=4;Eliminates flickering laptop display on Ultra Voltage processors

1 Option Description
2 quiet Downloading without text messages
3 splash Show welcome window
4 noplymouth Disable Plymouth
5 acpi=off Disable ACPI
6 noapic Disable APIC
7 nolapic Disable local APIC
8 single Single User Mode
9 nomodeset Disable kernel selection and loading of video drivers
10 915.enable_dc=0 Disable GPU power management
11 ahci.mobile_lpm_policy=1 Maximum performance, power management
12 snd-intel-dspcfg.dsp_driver=1 Forced selection of an Intel sound device driver
13 intel_idle.max_cstate=1 Prevents the processor from going into a deep sleep state
14 intel_idle.max_cstate=4 Eliminates flickering laptop display on Ultra Voltage processors

@ -1 +1 @@
ubbeep,1 22 333 4444 5555 ubbeep;1 22 333 4444 5555
1 ubbeep 1 22 333 4444 5555

@ -1,6 +1,6 @@
Option,Description Option;Description
console,PC BIOS & EFI console console;PC BIOS & EFI console
serial,Serial terminal serial;Serial terminal
ofconsole,Open Firmware Console ofconsole;Open Firmware Console
at_keyboard,PC AT Keyboard (Coreboot) at_keyboard;PC AT Keyboard (Coreboot)
usb_keyboard,USB Keyboard (HID Boot protocol) usb_keyboard;USB Keyboard (HID Boot protocol)

1 Option Description
2 console PC BIOS & EFI console
3 serial Serial terminal
4 ofconsole Open Firmware Console
5 at_keyboard PC AT Keyboard (Coreboot)
6 usb_keyboard USB Keyboard (HID Boot protocol)

@ -1,6 +1,6 @@
Option,Description Option;Description
console,PC BIOS & EFI console console;PC BIOS & EFI console
serial,Serial terminal serial;Serial terminal
ofconsole,Open Firmware Console ofconsole;Open Firmware Console
gfxterm,Output in graphical mode gfxterm;Output in graphical mode
vga_text,VGA text output (Coreboot) vga_text;VGA text output (Coreboot)

1 Option Description
2 console PC BIOS & EFI console
3 serial Serial terminal
4 ofconsole Open Firmware Console
5 gfxterm Output in graphical mode
6 vga_text VGA text output (Coreboot)

@ -734,7 +734,7 @@ void MainWindow::set_data_csv_melody() {
Gtk::TreeModel::Row row = *iter; Gtk::TreeModel::Row row = *iter;
code_melodyes = row[m_columns_melody.melody_code] + ""; code_melodyes = row[m_columns_melody.melody_code] + "";
if (code_melodyes.length() != 0 && (row[m_columns_melody.title] + "").length() != 0) { if (code_melodyes.length() != 0 && (row[m_columns_melody.title] + "").length() != 0) {
all_melody += row[m_columns_melody.title] + "," + code_melodyes + "\n"; all_melody += row[m_columns_melody.title] + ";" + code_melodyes + "\n";
if (row[m_columns_melody.check_button]) { if (row[m_columns_melody.check_button]) {
map_cmd_selection["GRUB_PLAY"] = code_melodyes + ""; map_cmd_selection["GRUB_PLAY"] = code_melodyes + "";
} }
@ -749,11 +749,7 @@ void MainWindow::set_data_csv_melody() {
} }
} }
if (all_melody_old != all_melody) { if (all_melody_old != all_melody) {
ofstream fout(path_name, ios_base::out | ios_base::trunc); Utils::write_file(path_name, all_melody);
if (fout.is_open()) {
fout << all_melody;
fout.close();
}
} }
} }

@ -8,7 +8,7 @@ array<vector<string>, 5> read_csv(const string& filename) {
vector<string> vec_opcision; vector<string> vec_opcision;
ifstream file(filename); ifstream file(filename);
string line; string line;
char delimiter = ','; char delimiter = ';';
getline(file, line); getline(file, line);
while (getline(file, line)) { while (getline(file, line)) {
stringstream stream(line); stringstream stream(line);
@ -50,11 +50,19 @@ array<vector<string>, 5> read_csv(const string& filename) {
return array_vectors; return array_vectors;
} }
void write_file(string path_name, string data) {
ofstream fout(path_name, ios_base::out | ios_base::trunc);
if (fout.is_open()) {
fout << data;
fout.close();
}
}
vector<tuple<string, string>> read_csv_melody(const string& filename) { vector<tuple<string, string>> read_csv_melody(const string& filename) {
vector<tuple<string, string>> vec_music; vector<tuple<string, string>> vec_music;
ifstream file(filename); ifstream file(filename);
string line; string line;
char delimiter = ','; char delimiter = ';';
while (getline(file, line)) { while (getline(file, line)) {
stringstream stream(line); stringstream stream(line);
string name; string name;

@ -46,5 +46,6 @@ void str_remove(std::string& source, std::string to_remove);
void str_replace_all(string &str_base, string str_find, string str_replace); void str_replace_all(string &str_base, string str_find, string str_replace);
std::vector<std::string> split(std::string text, char delim); std::vector<std::string> split(std::string text, char delim);
vector<tuple<string, string>> read_csv_melody(const string& filename); vector<tuple<string, string>> read_csv_melody(const string& filename);
void write_file(string path_name, string data);
} }
#endif #endif
Loading…
Cancel
Save