API Documentation
Loading...
Searching...
No Matches
VehicleDatabase.h
Go to the documentation of this file.
1#pragma once
3#include "Base/Headers/File.h"
7namespace NDEVR
8{
9 class VehicleDatabase;
11 {
12 public:
13 VehicleRecord(uint04 index, const VehicleDatabase* database);
14 const String& make() const;
15 const String& model() const;
16 const uint04& year() const;
17 const fltp08& curbWeight() const;
18 const Vector<3, fltp08> dimensions() const;
19 File modelFile() const;
20 protected:
23 };
25 {
33
34 VehicleSearchItem(const File& default_file)
35 : INIInterface(default_file)
36 {};
37 bool isValid(const VehicleRecord& record) const;
38 uint04 score(const VehicleRecord& record) const;
39 void getINI(INIFactory& factory) override;
40 };
42 {
43 public:
46
47 void readDatabaseFromFolder(const File& folder);
48 void readSearchTermsFromFolder(const File& folder);
49 void readFromDBF(const File& f);
50 Buffer<uint04> filterModels(const String& make, const String& model, uint04 year) const;
51 bool recordFilterPass(uint04 record_number, const String& make, const String& model, uint04 year) const;
52 uint04 recordCount() const { return vehicle_makes.size(); }
53 VehicleRecord record(uint04 i) const { return VehicleRecord(i, this); }
54 Buffer<String> getMakes(const String& model = String(), uint04 year = Constant<uint04>::NaN) const;
55 Buffer<String> getModels(const String& make = String(), uint04 year = Constant<uint04>::NaN) const;
56 Buffer<uint04> getYears(const String& make = String(), const String& model = String()) const;
57 static VehicleDatabase& DefaultDatabase();
58 public:
59 static uint04 ParseYear(const File& f);
60 public:
70 };
71}
#define VEHICLE_DATABASE_API
Definition DLLInfo.h:78
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition File.h:47
Definition INIReader.h:57
Definition INIInterface.h:40
Definition String.h:40
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
Definition VehicleDatabase.h:42
VehicleRecord record(uint04 i) const
Definition VehicleDatabase.h:53
Buffer< fltp08 > curb_weight
Definition VehicleDatabase.h:68
Buffer< fltp08 > overall_height
Definition VehicleDatabase.h:66
Buffer< String > vehicle_makes
Definition VehicleDatabase.h:61
Buffer< fltp08 > wheel_base
Definition VehicleDatabase.h:67
uint04 recordCount() const
Definition VehicleDatabase.h:52
Buffer< fltp08 > overall_width
Definition VehicleDatabase.h:65
Buffer< String > vehicle_models
Definition VehicleDatabase.h:62
Buffer< VehicleSearchItem > file_search_terms
Definition VehicleDatabase.h:69
Buffer< uint04 > vehicle_year
Definition VehicleDatabase.h:63
VehicleDatabase()
Definition VehicleDatabase.h:44
Buffer< fltp08 > overall_length
Definition VehicleDatabase.h:64
Definition VehicleDatabase.h:11
const uint04 m_index
Definition VehicleDatabase.h:22
const VehicleDatabase *const m_database
Definition VehicleDatabase.h:21
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition BaseValues.hpp:272
Definition VehicleDatabase.h:25
String make_exclude_terms
Definition VehicleDatabase.h:28
File model_file
Definition VehicleDatabase.h:30
String make_search_terms
Definition VehicleDatabase.h:26
String model_search_terms
Definition VehicleDatabase.h:27
String model_exclude_terms
Definition VehicleDatabase.h:29
VehicleSearchItem(const File &default_file)
Definition VehicleDatabase.h:34