Skip to content

Commit

Permalink
[#3] Added RawJPG model class
Browse files Browse the repository at this point in the history
  • Loading branch information
Clovel committed Jun 10, 2019
1 parent 584ffb9 commit cbb0a30
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/RawJPG.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* RawJPG
*/

/* Include --------------------------------------------- */
#include "RawJPG.hpp"

#include <iostream>

/* Defines --------------------------------------------- */

/* Class implentation ---------------------------------- */
std::ostream &operator<<(std::ostream &pOs, const RawJPG &pRawJPG) {
pOs << "RawJPG data : " << pRawJPG.rawData();

return pOs;
}

RawJPG::RawJPG() {
/* Empty on purpose */
}

RawJPG::RawJPG(const std::string &pStr) : mRawData(pStr)
{
/* Empty on purpose */
}

RawJPG::~RawJPG() {
/* Empty on purpose */
}

void RawJPG::print(void) const {
std::cout << "[INFO ] RawJPG value is : " << *this << std::endl;
}

/* Getters */
std::string RawJPG::rawData(void) const {
return mRawData;
}

bool RawJPG::isComplete(void) const {
return mComplete;
}

/* Setters */
void RawJPG::setRawData(const std::string &pStr) {
mRawData = pStr;
}

void RawJPG::setCompleted(const bool &pComplete) {
mComplete = pComplete;
}
37 changes: 37 additions & 0 deletions src/RawJPG.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* RawJPG
*/

#ifndef RAW_JPG_HPP
#define RAW_JPG_HPP

/* Include --------------------------------------------- */
#include <string>

/* Defines --------------------------------------------- */

/* Class ----------------------------------------------- */
class RawJPG {
public:
RawJPG();
RawJPG(const std::string &pStr);
virtual ~RawJPG();

void print(void) const;

/* Getters */
std::string rawData(void) const;
bool isComplete(void) const;

/* Setters */
void setRawData(const std::string &pStr);
void setCompleted(const bool &pStr);

private:
std::string mRawData;
bool mComplete;
};

std::ostream &operator<<(std::ostream &pOs, const RawJPG &pRawJPG);

#endif /* RAW_JPG_HPP */

0 comments on commit cbb0a30

Please sign in to comment.