Browse Source

Added assignment and move operators to TokenizeResult

release/0.19
JustinAJ 9 years ago
parent
commit
b6f9ced59a
  1. 8
      Jupiter/Readable_String.h
  2. 25
      Jupiter/Readable_String_Imp.h
  3. BIN
      Release/Jupiter.lib

8
Jupiter/Readable_String.h

@ -361,12 +361,18 @@ namespace Jupiter
/**
* @brief Move constructor for the TokenizeResult class.
*/
TokenizeResult(const TokenizeResult &&source);
TokenizeResult(TokenizeResult &&source);
/**
* @brief Destructor for the TokenizeResult class.
*/
~TokenizeResult();
/** Assignment Operator */
inline TokenizeResult<R> &operator=(const TokenizeResult<R> &right);
/** Move Operator */
inline TokenizeResult<R> &operator=(TokenizeResult<R> &&right);
};
/**

25
Jupiter/Readable_String_Imp.h

@ -1332,7 +1332,7 @@ template<typename T> template<template<typename> class R> Jupiter::Readable_Stri
}
}
template<typename T> template<template<typename> class R> Jupiter::Readable_String<T>::TokenizeResult<R>::TokenizeResult(const TokenizeResult &&source)
template<typename T> template<template<typename> class R> Jupiter::Readable_String<T>::TokenizeResult<R>::TokenizeResult(TokenizeResult &&source)
{
Jupiter::Readable_String<T>::TokenizeResult<R>::tokens = source.tokens;
Jupiter::Readable_String<T>::TokenizeResult<R>::token_count = source.token_count;
@ -1353,6 +1353,29 @@ template<typename T> template<template<typename> class R> const R<T> &Jupiter::R
return R<T>::empty;
}
// TokenizeResult Operators
template<typename T> template<template<typename> class R> inline typename Jupiter::Readable_String<T>::TokenizeResult<R> &Jupiter::Readable_String<T>::TokenizeResult<R>::operator=(typename const Jupiter::Readable_String<T>::TokenizeResult<R> &right)
{
Jupiter::Readable_String<T>::TokenizeResult<R>::tokens = new R<T>[source.token_count];
Jupiter::Readable_String<T>::TokenizeResult<R>::token_count = 0;
while (Jupiter::Readable_String<T>::TokenizeResult<R>::token_count != source.token_count)
{
Jupiter::Readable_String<T>::TokenizeResult<R>::tokens[Jupiter::Readable_String<T>::TokenizeResult<R>::token_count] = source.tokens[Jupiter::Readable_String<T>::TokenizeResult<R>::token_count];
++Jupiter::Readable_String<T>::TokenizeResult<R>::token_count;
}
return *this;
}
template<typename T> template<template<typename> class R> inline typename Jupiter::Readable_String<T>::TokenizeResult<R> &Jupiter::Readable_String<T>::TokenizeResult<R>::operator=(typename Jupiter::Readable_String<T>::TokenizeResult<R> &&right)
{
Jupiter::Readable_String<T>::TokenizeResult<R>::tokens = source.tokens;
Jupiter::Readable_String<T>::TokenizeResult<R>::token_count = source.token_count;
source.tokens = nullptr;
source.token_count = 0;
return *this;
}
// tokenize
template<typename T> template<template<typename> class R> typename Jupiter::Readable_String<T>::TokenizeResult<R> Jupiter::Readable_String<T>::tokenize(const Jupiter::Readable_String<T> &in, const T &token)

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save