📄 manager.hpp
字号:
#ifndef manager_hpp_inc
#define manager_hpp_inc 1
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string>
#include <time.h>
#include "Uzytkownik.hpp"
using namespace std;
class Manager {
private:
string katalog;
int usize;
// Tworzenie Managera.
void createManager(int size) {
this -> katalog = "users\\";
this -> plikKont = "konta.sxd";
this -> length = 0;
this -> konta = new string[size];
this -> usize = 50;
char plik[10];
ifstream fin(this -> plikKont);
if(fin) {
char buffer[28];
for(int i = 0; i < 28; buffer[i++] = '\0');
int i = 0;
int k = 0;
char ch = '\0';
while(fin.get(ch)) {
if(ch == '\n') {
k = 0;
i = this -> length;
this -> konta[i] = (string)buffer;
//cout << "Dodano konto nr " << this -> konta[i] << endl;
this -> length++;
if(this -> length >= this -> size - 1) {
string *stmp = new string[this -> length];
for(int w = 0; w < this -> length; w++) {
stmp[w] = this -> konta[w];
}
delete(this -> konta);
this -> size += usize;
this -> konta = new string[this -> size];
for(int w = 0; w < this -> length; w++) {
this -> konta[w] = stmp[w];
}
delete(stmp);
}
} else if(ch == '\r') {
} else {
buffer[k] = ch;
k++;
}
}
}
fin.close();
}
public:
char *plikKont; // Plik z numerami kont.
string *konta; // Tablica z odczytanymi numerami kont.
int size; // Ile kont mo縠 pomie渃i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -