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

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

@ -1,14 +1,14 @@
Option,Description
quiet,Downloading without text messages
splash,Show welcome window
noplymouth,Disable Plymouth
acpi=off,Disable ACPI
noapic,Disable APIC
nolapic,Disable local APIC
single,Single User Mode
nomodeset,Disable kernel selection and loading of video drivers
915.enable_dc=0,Disable GPU 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
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
Option;Description
quiet;Downloading without text messages
splash;Show welcome window
noplymouth;Disable Plymouth
acpi=off;Disable ACPI
noapic;Disable APIC
nolapic;Disable local APIC
single;Single User Mode
nomodeset;Disable kernel selection and loading of video drivers
915.enable_dc=0;Disable GPU 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
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

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
console,PC BIOS & EFI console
serial,Serial terminal
ofconsole,Open Firmware Console
at_keyboard,PC AT Keyboard (Coreboot)
usb_keyboard,USB Keyboard (HID Boot protocol)
Option;Description
console;PC BIOS & EFI console
serial;Serial terminal
ofconsole;Open Firmware Console
at_keyboard;PC AT Keyboard (Coreboot)
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
console,PC BIOS & EFI console
serial,Serial terminal
ofconsole,Open Firmware Console
gfxterm,Output in graphical mode
vga_text,VGA text output (Coreboot)
Option;Description
console;PC BIOS & EFI console
serial;Serial terminal
ofconsole;Open Firmware Console
gfxterm;Output in graphical mode
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;
code_melodyes = row[m_columns_melody.melody_code] + "";
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]) {
map_cmd_selection["GRUB_PLAY"] = code_melodyes + "";
}
@ -749,11 +749,7 @@ void MainWindow::set_data_csv_melody() {
}
}
if (all_melody_old != all_melody) {
ofstream fout(path_name, ios_base::out | ios_base::trunc);
if (fout.is_open()) {
fout << all_melody;
fout.close();
}
Utils::write_file(path_name, all_melody);
}
}

@ -8,7 +8,7 @@ array<vector<string>, 5> read_csv(const string& filename) {
vector<string> vec_opcision;
ifstream file(filename);
string line;
char delimiter = ',';
char delimiter = ';';
getline(file, line);
while (getline(file, line)) {
stringstream stream(line);
@ -50,11 +50,19 @@ array<vector<string>, 5> read_csv(const string& filename) {
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>> vec_music;
ifstream file(filename);
string line;
char delimiter = ',';
char delimiter = ';';
while (getline(file, line)) {
stringstream stream(line);
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);
std::vector<std::string> split(std::string text, char delim);
vector<tuple<string, string>> read_csv_melody(const string& filename);
void write_file(string path_name, string data);
}
#endif
Loading…
Cancel
Save