final app

This commit is contained in:
2020-01-11 07:05:54 +01:00
parent dcfb945c0b
commit 31fe531703
68 changed files with 62242 additions and 129 deletions

51
SocketLibrary/Message.h Normal file
View File

@@ -0,0 +1,51 @@
#pragma once
#include <string>
#include "Result.h"
namespace SocketLibrary
{
enum class TypeOfMsg
{
Unknown,
Text,
File,
Command
};
enum class Command
{
Unknown,
LogIn,
LogOut,
Adress,
ConnCheck,
FileName
};
class Message
{
public:
Message();
Result Parse(const std::string& msg, int size);
std::string PrepareText(const std::string& msg, std::string name);
std::string PrepareFile(const std::string& msg, std::string name, int totalLenght);
std::string PrepareCommand(const std::string& msg, std::string name, Command cmd);
std::string GetName();
TypeOfMsg GetType();
int GetLenght();
int GetTotalLenght();
std::string GetMsg();
Command GetCommand();
std::string GetFileName();
private:
std::string _name;
TypeOfMsg _typeOfMsg;
int _lenght;
int _totalLenght;
std::string _message;
Command _command;
std::string _filename;
};
}