-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutput.cpp
More file actions
48 lines (39 loc) · 1.75 KB
/
Copy pathOutput.cpp
File metadata and controls
48 lines (39 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
#include <algorithm>
#include "Output.h"
namespace {
// Cores para o output
const std::string PADRAO = "\033[0m";
const std::string VERDE = "\033[1;32m";
const std::string VERMELHO = "\033[1;31m";
const std::string AZUL = "\033[1;34m";
}
void Output::usage() {
std::cout << "Uso: ./dnaprofiler -d <database_file> -s <dna_sequence_file>\n";
std::cout << " Onde os argumentos são:\n";
std::cout << " <database_file> O arquivo correspondente à base de DNA.\n";
std::cout << " <dna_sequence_file> O arquivo contendo a sequência de DNA que você deseja identificar." << PADRAO << "\n\n";
}
void Output::welcome() {
std::cout << "Welcome to the C++ DNA Profiler, v1.0\n";
std::cout << "Copyright (C) 2026, Hugo Araujo\n";
std::cout << AZUL << "This programa loads a DNA database and an unknown DNA sequence and tries\n";
std::cout << "to find a match between the input DNA sequence and the DNA database." << PADRAO << "\n";
}
void Output::loading(const std::string& descricao, const std::string& caminho, bool ok) {
std::cout << "[+] Loading " << descricao << " [" << VERMELHO << caminho << PADRAO << "] ...";
if (ok) std::cout << VERDE << "[OK]" << PADRAO << "\n";
else std::cout << VERMELHO << "[FAIL]" << PADRAO << "\n";
}
void Output::searching() {
std::cout << "[+] Searching the database for a match... Please wait.\n";
int largura = 78;
for (int p = 0; p <= largura; p++) {
std::cout << "\r[" << std::string(p, '=') << std::string(largura - p, ' ') << "] " << (p * 100 / largura) << " %" << std::flush;
std::this_thread::sleep_for(std::chrono::milliseconds(6));
}
std::cout << "\n\n";
}