Verified Commit 4ab82328 authored by Matthew Burket's avatar Matthew Burket
Browse files

Updated project docs

parent 6681164d
commit 6681164dccc8b35af67b49e9f3e5a85d7dd2ef21
Author: Matthew Burket <m@tthewburket.com>
Date: Fri Apr 21 17:30:01 2017 -0500
Started CHANGELOG
CHANGELOG | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)
commit 3ff96b79da99627452596400c982ca593ca258a6
Author: Matthew Burket <m@tthewburket.com>
Date: Fri Apr 21 17:29:37 2017 -0500
......
......@@ -3,5 +3,11 @@ The RFCs where access from https://tools.ietf.org
I also used WiresShark on my connection to an IRC Server to see how a real IRC client and server work.
My Makefile is based off the instructor's Makefile from Assignment 1.09
StringSocket.cpp - A C++ Wrapper around
\ No newline at end of file
StringSocket.cpp/h - A C++ Wrapper around raw C sockets. Added APIs to easily talk strings over the socket
Connection.cpp/h - Represnets one users session to an IRC Server
Channel.cpp/h - Represents a channel
There is a lot code that stills needs to be written. Such as the code to handle new message, being kick from a room,
being killed from a server.
\ No newline at end of file
//
// Created by Matthew Burket on 4/19/17.
//
#include "Utils.h"
#include <vector>
/**
* Checks if target is at the start of the string
*
* @param target The string to search for
* @param subject The string the target should be in
* @return if the string
*/
bool Utils::starts_with(std::string target, std::string subject) {
return subject.compare(0, target.length(), target) == 0;
}
std::vector<std::string> Utils::split_string(char split, std::string s) {
std::vector<std::string> result;
return result;
}
\ No newline at end of file
//
\ No newline at end of file
......@@ -5,14 +5,46 @@
#ifndef COMS327_IRC_UTILS_H
#define COMS327_IRC_UTILS_H
#define CRLF "\\r\\n"
#include <iostream>
#include <string>
#include <vector>
class Utils {
static bool starts_with(std::string target, std::string subject);
static std::vector<std::string> split_string(char split, std::string s);
public:
/**
* Checks if target is at the start of the string
*
* @param target The string to search for
* @param subject The string the target should be in
* @return if the string
*/
static bool starts_with(std::string target, std::string subject) {
return subject.compare(0, target.length(), target) == 0;
}
/**
* Splits a string on given char
*
* @param split the char to split on
* @param s the string to split
* @return an array of elments from the string
*/
static std::vector<std::string> split_string(char split, std::string s) {
std::string element;
std::vector<std::string> result;
for (int i = 0; i < s.length(); i++) {
if (s[i] == split) {
result.push_back(element);
element = "";
} else {
element += s[i];
}
}
return result;
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment