-
Notifications
You must be signed in to change notification settings - Fork 0
/
CSVtoXMLConverter1.cpp
52 lines (49 loc) · 1.29 KB
/
CSVtoXMLConverter1.cpp
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
49
50
51
52
//Creating objects in stack and heap
#include<string>
#include<iostream>
using namespace std;
class LocationModel {
private:
string name;
float coOrdinate;
static int inCounter;//Will not create a state for the same as we are using Static keyword
public:
static void dumpCounter(){}
string getName(LocationModel *this) {//LocationModel * this is added implicitely by compiler
return this->name;
}
void setName(LocationModel *this, string value) {
//LocationModel * this is added implicitely by compiler
this->name = value;//name = value;
}
};
class LocationCSVDataReader {
private:
string filePath;
};
class Converter {
public:
void Convert(std::string filePath) {
//logic
//Read CSV file line by line
//Split each line - ","
//represent line content
//Validate line
//Create XML node
//update XM tree
//save XML tree
}
};
int main_()
{
//stck objects
int x;//int datatype
LocationModel obj;//User Defined Datatype
obj.setName("BLR");//LocationModel::setName(&obj, "BLR");
obj.getName();//LocationModel::getName(&obj);
//Heap Allocation
LocationModel* ptr =new LocationModel();
ptr->setName("DEL");
LocationModel::dumpCounter();//writing this to call dumpCounter to execute without having a object or state
return 0;
}