#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>
#include "interpretSeeds.h"
Go to the source code of this file.
|
void | getLuxury (boost::tokenizer< boost::char_separator< char > >::iterator &token, short &luxLevel) |
|
void | getOffset (boost::tokenizer< boost::char_separator< char > >::iterator &token, uint32_t &offset) |
|
bool | interpretSeeds (const std::string &buffer, std::string &stream, uint32_t &seed1, uint32_t &seed2, short &luxury, uint32_t &offset) |
|
bool | interpretSeeds (const std::string &buffer, std::string &stream, std::vector< uint32_t > &seeds) |
|
◆ getLuxury()
void getLuxury |
( |
boost::tokenizer< boost::char_separator< char > >::iterator & |
token, |
|
|
short & |
luxLevel |
|
) |
| |
|
inline |
Definition at line 12 of file interpretSeeds.cxx.
13 if ((*token) ==
"LUXURY") {
14 luxLevel = boost::lexical_cast<uint32_t>(*(++token));
◆ getOffset()
void getOffset |
( |
boost::tokenizer< boost::char_separator< char > >::iterator & |
token, |
|
|
uint32_t & |
offset |
|
) |
| |
|
inline |
Definition at line 21 of file interpretSeeds.cxx.
22 if ((*token) ==
"OFFSET") {
23 offset = boost::lexical_cast<uint32_t>(*(++token));
◆ interpretSeeds() [1/2]
bool interpretSeeds |
( |
const std::string & |
buffer, |
|
|
std::string & |
stream, |
|
|
std::vector< uint32_t > & |
seeds |
|
) |
| |
Definition at line 62 of file interpretSeeds.cxx.
66 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
67 boost::char_separator<char>
sep(
" ");
70 bool status = (nToks == 31 || nToks == 33 || nToks == 771);
76 if (nToks == 32) nToks=30;
77 for (
int i=0;
i<nToks;
i++) {
78 #if defined(__GNUC__) && !defined(__clang__)
79 #pragma GCC diagnostic push
80 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
82 seeds.push_back(boost::lexical_cast<uint32_t>(*token++));
83 #if defined(__GNUC__) && !defined(__clang__)
84 #pragma GCC diagnostic pop
87 }
catch (
const boost::bad_lexical_cast&
e) {
◆ interpretSeeds() [2/2]
bool interpretSeeds |
( |
const std::string & |
buffer, |
|
|
std::string & |
stream, |
|
|
uint32_t & |
seed1, |
|
|
uint32_t & |
seed2, |
|
|
short & |
luxury, |
|
|
uint32_t & |
offset |
|
) |
| |
Definition at line 28 of file interpretSeeds.cxx.
32 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
33 boost::char_separator<char>
sep(
" ");
36 bool status = (nToks == 3 || nToks == 5 || nToks == 7);
46 #if defined(__GNUC__) && !defined(__clang__)
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
50 seed1 = boost::lexical_cast<uint32_t>(*token++);
51 seed2 = boost::lexical_cast<uint32_t>(*token++);
52 #if defined(__GNUC__) && !defined(__clang__)
53 #pragma GCC diagnostic pop
55 }
catch (
const boost::bad_lexical_cast&
e) {