Skip to content

Commit cbf0a26

Browse files
committed
Utilitaire & Init
1 parent 5b366d1 commit cbf0a26

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

headers/FPL_F.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#pragma once
2+
3+
#include <iostream>
4+
#include <string>
5+
#include <vector>
6+
#include <sstream>
7+
#include <algorithm>
8+
#include "Management_Envoyer.h"
9+
10+
// Utils
11+
12+
std::vector<std::string> split(std::string& arg) {
13+
std::string myBuffer;
14+
15+
std::vector<std::string> myVec;
16+
17+
std::stringstream ss;
18+
ss << arg;
19+
while (ss >> myBuffer) {
20+
myVec.push_back(myBuffer);
21+
}
22+
23+
return myVec;
24+
}
25+
26+
std::vector<char> splitChar(std::string& arg) {
27+
std::istringstream iss(arg);
28+
std::vector<char> vec((std::istream_iterator<char>(iss)), std::istream_iterator<char>());;
29+
30+
return vec;
31+
}
32+
33+
std::string replace(std::string& line, std::string& what) {
34+
std::string result = line.replace(line.find(what), what.length(), "");
35+
return result;
36+
}
37+
38+
39+
40+
// FPL
41+
42+
void FrenchProgrammingLanguage_Init(std::vector<std::string>& content_line_slitted, std::string& line) {
43+
if (content_line_slitted[0] == "envoyer") {
44+
FPL_Print_Init(content_line_slitted, line);
45+
}
46+
else {
47+
std::cout << "FPL Erreur : Je n'ai pas trouve votre demande !" << std::endl;
48+
}
49+
}

0 commit comments

Comments
 (0)