-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.h
More file actions
34 lines (24 loc) · 812 Bytes
/
Copy pathhelpers.h
File metadata and controls
34 lines (24 loc) · 812 Bytes
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
#pragma once
#include <fstream>
#include "MyString.h"
#include "DataObject.h"
bool isUpperLetter(char letter);
bool isLowerLetter(char letter);
bool isCharDigit(char symbol);
bool contains(const MyString& str, bool (*criteria)(char));
bool isInputValidIndex(const MyString& string);
MyVector<MyString> splitInputInCommandAndValue(const MyString& input);
void print(const char* str);
void print(const MyString& str);
template <typename T>
const DataObject* searchInCollectionById(const MyVector<T> collection, size_t id);
template<typename T>
inline const DataObject* searchInCollectionById(const MyVector<T> collection, size_t id)
{
for (size_t i = 0; i < collection.getSize(); i++)
{
if (id == collection[i].getId())
return &collection[i];
}
return nullptr;
}