Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
5316ba2
created empty files
mcquerol Dec 31, 2024
fbda1cd
testing that the poco library is working
mcquerol Dec 31, 2024
1b2fcb3
implemented attributes into uml diagram
mcquerol Dec 31, 2024
5a2ffec
implemented attributes from uml diagram
mcquerol Dec 31, 2024
47c3fd6
added constructors and getters
mcquerol Jan 1, 2025
aa4fb3d
removed setters to keep class immutable
mcquerol Jan 1, 2025
ecbaabc
added matrikelnumber to constructor and fixed dateOfBirth attribute name
mcquerol Jan 1, 2025
9327b30
removed setteers to keep class immutable
mcquerol Jan 1, 2025
e14afce
fixed data types of getters
mcquerol Jan 1, 2025
4b63b9c
fixed const correctness
mcquerol Jan 1, 2025
020b690
defined constructors and getters
mcquerol Jan 1, 2025
d74ae07
removed the definition of nextmatrikelnumber and moved it to
mcquerol Jan 1, 2025
3db4f08
fixed #endif directives
mcquerol Jan 1, 2025
2778723
removed 'unsigned' from std::map
mcquerol Jan 1, 2025
ce8a13e
Added define majorById map
mcquerol Jan 1, 2025
787cd5c
fixed map getters
mcquerol Jan 1, 2025
279b0c6
fixed course getter
mcquerol Jan 1, 2025
dc6a099
fixed matrikelnumber spelling
mcquerol Jan 1, 2025
408fe8c
updated static attribute
mcquerol Jan 1, 2025
79cadd2
updated course getter
mcquerol Jan 1, 2025
29f6eec
fixed key/value assignment
mcquerol Jan 1, 2025
b51b36b
changed the constructor to accept major as a string
mcquerol Jan 1, 2025
b4eb254
changed the getter to return string
mcquerol Jan 1, 2025
1fbdfe1
changed constructor and getter so that the major can be passed as a
mcquerol Jan 1, 2025
0e64f7f
fixed brackets
mcquerol Jan 2, 2025
61e8e31
added helper functions based on requirements
mcquerol Jan 5, 2025
4459886
implemented switch statement with input and helper functions
mcquerol Jan 5, 2025
56dff34
added studentdb attribute as private member to be accessed in run
mcquerol Jan 6, 2025
1a84c38
set constructor reference to the privvate attributue
mcquerol Jan 6, 2025
9d33798
added course and student setters for creating new courses and students
mcquerol Jan 6, 2025
e6c16a1
implemented setter methods to add a new couurse and student to each map
mcquerol Jan 6, 2025
b5a9238
implemented setter methods to add a new course and student to the map
mcquerol Jan 6, 2025
39131ee
fixed constructor and fixed inheritence issue
mcquerol Jan 6, 2025
7715adb
fixed constructor and inheritance issue and created setters
mcquerol Jan 6, 2025
c6fc63f
changed private members to protected to be accessable by child classes
mcquerol Jan 6, 2025
11a5d95
fixed cin
mcquerol Jan 6, 2025
c6565d4
added destructor for abtract class
mcquerol Jan 6, 2025
6fdf0cb
added setters
mcquerol Jan 11, 2025
9692a10
tried to resolve the error with unique_ptr but there is an issue
mcquerol Jan 11, 2025
6b393bf
uncommented setters. prob undiagnosed
mcquerol Jan 11, 2025
4bb0ac2
fixed constructor
mcquerol Jan 11, 2025
9f11fea
changed private attribute from object to pointer to fix unique_ptr issue
mcquerol Jan 20, 2025
88a0b88
implemented add course method
mcquerol Jan 20, 2025
79c647c
changed insert to implace on setters for clarity
mcquerol Jan 20, 2025
b736769
implemented addCourse method
mcquerol Jan 24, 2025
7aee6ff
implemented listCourses method
mcquerol Jan 24, 2025
4ebafa1
moved enrollment getter and removed enrollment from constructor
mcquerol Jan 25, 2025
391b49d
fixed constructor and moved getter and added public address object
mcquerol Jan 25, 2025
72a4610
removed enrollments from constructor
mcquerol Jan 25, 2025
17cec8b
removed matrikelNumber from constructor because it is not required
mcquerol Jan 25, 2025
18c491a
removed matrikelNumber from constructor
mcquerol Jan 25, 2025
b83b56e
fixed typo in address attribute
mcquerol Jan 25, 2025
439504d
added address attributes to constructor and initialize public oject
mcquerol Jan 25, 2025
cc3f3f8
implemented addNewStudent method
mcquerol Jan 25, 2025
ee81f82
implemented addEnrollment method
mcquerol Jan 26, 2025
4047eb9
implemented setEnrollment
mcquerol Jan 26, 2025
8fb1ff3
added definition of setEnrollment
mcquerol Jan 26, 2025
c6f725b
added non-const getter for students map
mcquerol Jan 26, 2025
d3bf124
implemented printStudent
mcquerol Jan 26, 2025
d15022a
implemented searchStudent method
mcquerol Jan 26, 2025
e12ca92
added couts to each method to indicate which menu option is selected
mcquerol Jan 26, 2025
4ec3923
added setter for grade
mcquerol Jan 26, 2025
ea41495
added setters
mcquerol Jan 26, 2025
f073a90
added enrollment vector setter with no const to be accessible
mcquerol Jan 26, 2025
e827254
implemented updateStudent method
mcquerol Jan 26, 2025
5161f43
implemented a check in addEnrollment to check if an enrollment exists
mcquerol Jan 28, 2025
cc5e73f
instatiated db and SimpleUI objects
mcquerol Jan 28, 2025
064b041
fixed run method by adding the switch in an infinite loop
mcquerol Jan 28, 2025
f032869
fixed output formats for start and end dates
mcquerol Jan 28, 2025
7bb66d8
moved poco date object creation after parameters are initialized
mcquerol Jan 28, 2025
a03fae7
moved date in UpdateSearch method to after parameters are initialized
mcquerol Jan 28, 2025
3da0648
fixed switch statement for better readability
mcquerol Jan 28, 2025
7c0cd5a
changed the string cin's to getline's and corrected date formats
mcquerol Jan 28, 2025
f1674af
added while loops around the switch statement in updateSearch
mcquerol Jan 28, 2025
83f3877
fixed do while
mcquerol Jan 28, 2025
f4326a8
fixed syntax error
mcquerol Jan 28, 2025
ef852d9
fixed poco object creation causing jump in switch statement
mcquerol Jan 28, 2025
a036da2
added majorbyid map getter for major validation in simpleui class
mcquerol Jan 29, 2025
8ca2b5e
implemented various validation helper functions
mcquerol Jan 29, 2025
3cffbe2
updated postalcode validation
mcquerol Jan 29, 2025
8fe5833
changed all cin statements to helper validation functions
mcquerol Jan 29, 2025
c61ddf1
added function declarations of validation functions
mcquerol Jan 29, 2025
c0cc9f4
removed default values in function parameters to avoid errors
mcquerol Jan 29, 2025
5944d75
added a check to see if a course already exists before adding it
mcquerol Jan 29, 2025
114eb13
moved update menu display into do while so it displays after each update
mcquerol Jan 29, 2025
a887f33
fixed string validation using peek to avoid undefined variables
mcquerol Jan 29, 2025
014261a
fixed the check of duplicate enrollment
mcquerol Jan 29, 2025
8ea8c1b
fixed code formatting
mcquerol Jan 29, 2025
c22d561
added input validation for choice input in the run method
mcquerol Jan 30, 2025
5993244
declared virtual void write to write the base attributes to a csv file
mcquerol Jan 30, 2025
069be0f
implemented virtual void write to write base attributes to a csv file
mcquerol Jan 30, 2025
c0c43b9
added virtual void write for writing the base attributes to a csv file
mcquerol Jan 30, 2025
c99492c
declared write method to write base and child attributes to csv file
mcquerol Jan 30, 2025
9c6914d
declared write method to write base and child attributes to csv file
mcquerol Jan 30, 2025
22091c9
declared write method to write base and child attributes to csv file
mcquerol Jan 30, 2025
02c52b6
declared write method to write base and child attributes to csv file
mcquerol Jan 30, 2025
0a2cd80
added semicolon between B and startdate
mcquerol Jan 30, 2025
bb393ad
corrected ostream order
mcquerol Jan 30, 2025
fa845f1
corrected ostream order
mcquerol Jan 30, 2025
f587519
changed double quotes to single quotes
mcquerol Jan 30, 2025
2f11c51
declared write method to write adress attributes to osstream
mcquerol Jan 30, 2025
cb5faad
declared write method to write adress attributes to osstream
mcquerol Jan 30, 2025
50a1841
declared write to write student and address attributes in osstream
mcquerol Jan 30, 2025
9e74541
implemented write method to write to osstream
mcquerol Jan 30, 2025
e6c2035
implemented method to write enrollment data to osstream
mcquerol Jan 30, 2025
75e2826
declared method to write enrollment data to osstream
mcquerol Jan 30, 2025
1b664e3
declared method to write the studentDb data to a csv file
mcquerol Jan 30, 2025
d2a73c5
implemented method to write the studentDb data to a csv file
mcquerol Jan 30, 2025
d373c79
fixed spacing
mcquerol Jan 30, 2025
156ef3a
declared read method to read data from csv into studentdb
mcquerol Jan 30, 2025
3275001
added ostream include to fix ostream compiler error
mcquerol Jan 30, 2025
7173229
fixed poco date and time object because they are not overloaded
mcquerol Jan 30, 2025
9e098da
included ostream library and fixed const correctness of read method
mcquerol Jan 30, 2025
cb294c6
fixed const correctness of read method
mcquerol Jan 30, 2025
670297c
added ostream include and overloaded poco date and time objects
mcquerol Jan 30, 2025
43cfd90
added loop to try to clear enrollments vector
mcquerol Jan 30, 2025
cf42989
changed loop to clear enrollments vector by reference
mcquerol Jan 31, 2025
af136d8
fixed space formatting
mcquerol Jan 31, 2025
964164d
added clearEnrollments method
mcquerol Jan 31, 2025
c1e3a80
changed to clearEnrollments() method of student object
mcquerol Jan 31, 2025
3c9dd97
implemented parsing for weeklycourse
mcquerol Jan 31, 2025
a78be34
implemented parsing for block course data
mcquerol Feb 1, 2025
f7dbd8a
implemented parsing for student and address data
mcquerol Feb 1, 2025
da0d440
implemented enrollment parsing for csv data
mcquerol Feb 1, 2025
e8d0b57
added const cast in updateSearch method to access the enrollment getter
mcquerol Feb 1, 2025
e3507fb
fixed variable names and moved variable declarations
mcquerol Feb 1, 2025
ed77545
syntax
mcquerol Feb 1, 2025
eb18ea5
declared matrikel number setter
mcquerol Feb 1, 2025
103beae
declared matrikel number setter
mcquerol Feb 1, 2025
aa136e1
set highest matrikel number in the db with the highest of the csv file +
mcquerol Feb 1, 2025
143a44e
corrected write function
mcquerol Feb 1, 2025
ba03cce
fixed parsing for poco date and time
mcquerol Feb 1, 2025
769ff65
added read and write csv declarations
mcquerol Feb 1, 2025
2311667
fixed static method
mcquerol Feb 1, 2025
b3a454d
included fstream for csv read and write
mcquerol Feb 1, 2025
ad3445c
added endtime
mcquerol Feb 1, 2025
fa66ff2
initialized enrollmentsize variable
mcquerol Feb 1, 2025
a3333c5
fixed recursion crash by calling write method from base class
mcquerol Feb 1, 2025
3e077ea
sample input csv data
mcquerol Feb 1, 2025
035a2a8
sample output csv data
mcquerol Feb 1, 2025
863b190
declare read method for csv read
mcquerol Feb 2, 2025
c72b791
define read method for csv read
mcquerol Feb 2, 2025
2d64964
defined default constructor for creating temp object in studentdb
mcquerol Feb 2, 2025
d9196e5
defined default constructor for creating temp object in studentdb
mcquerol Feb 2, 2025
d667367
updated read method to use per-class read methods for better usability
mcquerol Feb 2, 2025
d9f17b4
added debug lines
mcquerol Feb 14, 2025
e04b916
recomment server connection code
mcquerol Feb 14, 2025
2b06fbb
check if next character is new line
mcquerol Feb 21, 2025
238bbab
check to see if next character is new line
mcquerol Feb 21, 2025
a63cc48
add debug statements for first and last name attributes
mcquerol Feb 21, 2025
d50cf31
change istringstream declaration and pass the same one to both read()
mcquerol Feb 21, 2025
6871a3a
changed dayofweek to int
mcquerol Feb 21, 2025
73b5568
check for empty line
mcquerol Feb 21, 2025
adf7e61
fix syntax
mcquerol Mar 1, 2025
d29fe78
try to fix the enrollments not printing
mcquerol Mar 1, 2025
d48a160
removed debug statements
mcquerol Mar 31, 2025
4919acc
changed data to see if it would reflect the change
mcquerol Mar 31, 2025
d86ac36
generated output from option 8 write to csv
mcquerol Mar 31, 2025
d30fa73
fixed the parsing error that it was reading an extra line
mcquerol Mar 31, 2025
d4384b4
removed a getline so it did not parse extra data
mcquerol Mar 31, 2025
9389017
removed courseType debug line
mcquerol Apr 1, 2025
ae80de4
declared obtainingTestData method
mcquerol Apr 1, 2025
da6943f
added obtainingTestData method and boost includes
mcquerol Apr 1, 2025
181e9b2
removed includes and obtainingTestData code
mcquerol Apr 1, 2025
fbf857c
attempted to enable multiple iterations
mcquerol Apr 1, 2025
83d1933
fixed #4 implemented the necessary data read from server data
mcquerol Apr 4, 2025
fb720f7
removed namespace and includes for obtainTestData()
mcquerol Apr 11, 2025
7140e6d
reset file to empty
mcquerol Apr 11, 2025
0852755
changed formatting of cout's
mcquerol Apr 11, 2025
d110a01
added json generation from local server using flask
mcquerol Apr 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.debug.git.280543543" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_PE64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.debug.git.280543543" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=" parent="cdt.managedbuild.config.gnu.mingw.debug.git">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.debug.git.280543543" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.dockerdpath=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.gnu.mingw.debug.git">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.debug.git.280543543." name="/" resourcePath="">
<toolChain id="de.h_da.eit.git.templates.toolchain.gnu.mingw.exe.debug.652589923" name="MinGW GCC (GIT/SWE/APT)" superClass="de.h_da.eit.git.templates.toolchain.gnu.mingw.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.541419187" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
Expand All @@ -25,7 +25,7 @@
<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.593528107" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option defaultValue="gnu.cpp.compiler.debugging.level.max" id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.400802399" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.other.other.1907466028" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -Wall -Werror=return-type" valueType="string"/>
<option id="gnu.cpp.compiler.option.dialect.std.1308346024" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++11" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.std.1308346024" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.665991857" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.746940659" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
Expand All @@ -35,9 +35,9 @@
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.188468351" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1666100549" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.libs.102755242" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
<listOptionValue builtIn="false" value="PocoData"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.libs.102755242" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
<listOptionValue builtIn="false" value="PocoFoundation"/>
<listOptionValue builtIn="false" value="PocoData"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2128728610" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
Expand Down Expand Up @@ -67,6 +67,11 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/studentDB"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>
2 changes: 1 addition & 1 deletion .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="613992491353852001" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="1742410616438529984" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
5 changes: 5 additions & 0 deletions .settings/org.eclipse.cdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
doxygen/doxygen_new_line_after_brief=true
doxygen/doxygen_use_brief_tag=false
doxygen/doxygen_use_javadoc_tags=true
doxygen/doxygen_use_pre_tag=false
doxygen/doxygen_use_structural_commands=false
eclipse.preferences.version=1
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.cdt.core.formatter.alignment_for_assignment=16
Expand Down
Binary file removed Debug/myCode/main.o
Binary file not shown.
Binary file removed Debug/studentDB.exe
Binary file not shown.
65 changes: 65 additions & 0 deletions local_json_fetch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from flask import Flask, jsonify
from faker import Faker
import random
import datetime

app = Flask(__name__)
fake = Faker()

def safe_fake_date(start_year=1971, end_year=2015):
while True:
dt = fake.date_time_between(start_date='-80y', end_date='-10y')
if dt.year >= start_year:
return dt

@app.route('/generate', methods=['GET'])
def generate_user():
dob = safe_fake_date()
reg = fake.date_time_between(start_date='-10y', end_date='now')

user_data = {
"cell": fake.phone_number(),
"dateOfBirth": {
"date": dob.day,
"day": dob.weekday(),
"hours": dob.hour,
"minutes": dob.minute,
"month": dob.month - 1,
"seconds": dob.second,
"time": int(dob.timestamp() * 1000),
"timezoneOffset": -60,
"year": dob.year - 1900
},
"email": fake.email(),
"gender": random.choice(["male", "female"]),
"location": {
"city": fake.city().lower(),
"postCode": fake.postcode(),
"state": fake.state().lower(),
"street": fake.street_address()
},
"name": {
"firstName": fake.first_name().lower(),
"lastName": fake.last_name().lower(),
"title": fake.prefix()
},
"nationality": fake.country_code(),
"phone": fake.phone_number(),
"picture": "...",
"registrationDate": {
"date": reg.day,
"day": reg.weekday(),
"hours": reg.hour,
"minutes": reg.minute,
"month": reg.month - 1,
"seconds": reg.second,
"time": int(reg.timestamp() * 1000),
"timezoneOffset": -60,
"year": reg.year - 1900
}
}

return jsonify(user_data)

if __name__ == '__main__':
app.run(port=4242)
65 changes: 65 additions & 0 deletions myCode/Address.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include "Address.h"
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

Address::Address()
{
}

Address::Address(std::string street, unsigned short postalCode, std::string cityName, std::string additionalInfo)
{
this->street = street;
this->postalCode = postalCode;
this->cityName = cityName;
this->additionalInfo = additionalInfo;
}

Address::~Address()
{
}

const std::string& Address::getAdditionalInfo() const
{
return additionalInfo;
}

const std::string& Address::getCityName() const
{
return cityName;
}

unsigned short Address::getPostalCode() const
{
return postalCode;
}

const std::string& Address::getStreet() const
{
return street;
}

void Address::write(std::ostream &out) const
{
out << street << ';' << postalCode << ';' << cityName << ';' << additionalInfo << "\n";
}

void Address::read(std::istream &in)
{
string line;

getline(in, street, ';');
getline(in, line, ';');
postalCode = static_cast<unsigned short>(stoi(line)); // Convert string to unsigned short
getline(in, cityName, ';');
if (in.peek() == '\n') {
additionalInfo = ""; // Explicitly set to empty
}
else
{
getline(in, additionalInfo);
}

}
33 changes: 33 additions & 0 deletions myCode/Address.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef ADRESS_H
#define ADRESS_H

#include <string>

class Address
{

private:

std::string street;
unsigned short postalCode;
std::string cityName;
std::string additionalInfo;

public:

Address();
Address(std::string street, unsigned short postalCode, std::string cityName, std::string additionalInfo);
~Address();

const std::string& getAdditionalInfo() const;
const std::string& getCityName() const;
unsigned short getPostalCode() const;
const std::string& getStreet() const;

void write(std::ostream& out) const; //write attributes to os stream
void read(std::istream& in);


};

#endif
132 changes: 132 additions & 0 deletions myCode/BlockCourse.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#include "BlockCourse.h"
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

BlockCourse::BlockCourse()
{
}

BlockCourse::BlockCourse(unsigned int courseKey, std::string title, std::string major, float creditPoints)
: Course(courseKey,title,major,creditPoints) {}

BlockCourse::~BlockCourse()
{
}

const Poco::Data::Time& BlockCourse::getStartTime() const
{
return startTime;
}

const Poco::Data::Time& BlockCourse::getEndTime() const
{
return endTime;
}

const Poco::Data::Date& BlockCourse::getStartDate() const
{
return startDate;
}

const Poco::Data::Date& BlockCourse::getEndDate() const
{
return endDate;
}

void BlockCourse::setStartTime(const Poco::Data::Time &startTime)
{
this->startTime = startTime;
}

void BlockCourse::setEndTime(const Poco::Data::Time &endTime)
{
this->endTime = endTime;
}

void BlockCourse::setStartDate(const Poco::Data::Date &startDate)
{
this->startDate = startDate;
}

void BlockCourse::setEndDate(const Poco::Data::Date &endDate)
{
this->endDate = endDate;
}

void BlockCourse::write(std::ostream &out) const
{
out << "B;";

Course::write(out);

out << startDate.day() << '.' << startDate.month() << '.' << startDate.year() << ';';
out << endDate.day() << '.' << endDate.month() << '.' << endDate.year() << ';';
out << startTime.hour() << '.' << startTime.minute() << '.' << startTime.second();
out << endTime.hour() << '.' << endTime.minute() << '.' << endTime.second()<< "\n";
}

void BlockCourse::read(std::istream &in)
{
string line;
string startTimeStr, endTimeStr, startDateStr, endDateStr;
int day, month, year;
int startHour, startMinute, startSecond, endHour, endMinute, endSecond;

Course::read(in);

getline(in, startDateStr, ';');
istringstream dateStreamStart(startDateStr);
getline(dateStreamStart, line, '.');

day = stoi(line);
getline(dateStreamStart, line, '.');

month = stoi(line);
getline(dateStreamStart, line, '.');

year = stoi(line);
startDate = Poco::Data::Date(year, month, day);

getline(in, endDateStr, ';');
istringstream dateStreamEnd(endDateStr);
getline(dateStreamEnd, line, '.');

day = stoi(line);
getline(dateStreamEnd, line, '.');

month = stoi(line);
getline(dateStreamEnd, line, '.');

year = stoi(line);
endDate = Poco::Data::Date(year, month, day);

getline(in, startTimeStr, ';');
istringstream timeStreamStart(startTimeStr);
getline(timeStreamStart, line, '.');

startHour = stoi(line);
getline(timeStreamStart, line, '.');

startMinute = stoi(line);
getline(timeStreamStart, line, '.');

startSecond = stoi(line);
startTime = Poco::Data::Time(startHour, startMinute, startSecond);

getline(in, endTimeStr, ';');
istringstream timeStreamEnd(endTimeStr);
getline(timeStreamEnd, line, '.');

endHour = stoi(line);
getline(timeStreamEnd, line, '.');

endMinute = stoi(line);
getline(timeStreamEnd, line, '.');

endSecond = stoi(line);
endTime = Poco::Data::Time(endHour, endMinute, endSecond);

}
Loading