Translation.cpp
Go to the documentation of this file.00001 #include "Translation.h"
00002
00003 Translation::Translation() {
00004 }
00005
00006 Translation::Translation( const QString lang, const QString word, const QString alt )
00007 : lang( lang ), word( word ), alt( alt ) {
00008 }
00009
00010 Translation::~Translation() {
00011 }
00012
00013 Translation::Translation( const Translation& trans )
00014 : lang( trans.lang ), word( trans.word ), alt( trans.alt ) {
00015 }
00016
00017 const QString Translation::getLanguage() const {
00018 return( lang );
00019 }
00020
00021 void Translation::setLanguage( const QString& language ) {
00022 this->lang = language;
00023 }
00024
00025 const QString Translation::getWord() const {
00026 return( word );
00027 }
00028
00029 void Translation::setWord( const QString& word ) {
00030 this->word = word;
00031 }
00032
00033 const QString Translation::getAlt() const {
00034 return( alt );
00035 }
00036
00037 void Translation::setAlt( const QString& alt ) {
00038 this->alt = alt;
00039 }
00040
00041 QDataStream& operator<<( QDataStream& out, const Translation& translation ) {
00042 out << translation.lang << translation.word << translation.alt;
00043 return( out );
00044 }
00045
00046 QDataStream& operator>>( QDataStream& in, Translation& translation ) {
00047 QString tempLang;
00048 QString tempWord;
00049 QString tempAlt;
00050
00051 in >> tempLang >> tempWord >> tempAlt;
00052 translation = Translation( tempLang, tempWord, tempAlt );
00053
00054 return( in );
00055 }
00056