126 |
|
if (!date.IsEmpty()) ::strptime(date.NullTerminate(), "%Y-%m-%d", day); |
127 |
|
|
128 |
|
std::time_t difference(mktime(day) / 86400); |
129 |
< |
ext::Vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
130 |
< |
ext::String entry(jargon.GetSize() ? jargon[difference % jargon.GetSize()] : ""); |
129 |
> |
std::vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
130 |
> |
ext::String entry(jargon.size() ? jargon[difference % jargon.size()] : ""); |
131 |
|
|
132 |
|
select(entry); |
133 |
|
} |
136 |
|
{ |
137 |
|
::srandomdev(); |
138 |
|
|
139 |
< |
ext::Vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
139 |
> |
std::vector<ext::String> jargon(this->jargon.begin(), this->jargon.end()); |
140 |
|
size_t random(number.IsEmpty() ? ::random() : lexical_cast<size_t>(number)); |
141 |
|
|
142 |
|
assert(random >= 0); |
143 |
< |
assert(random % jargon.GetSize() < jargon.GetSize()); |
143 |
> |
assert(random % jargon.size() < jargon.size()); |
144 |
|
|
145 |
< |
ext::String entry(jargon.GetSize() ? jargon[random % jargon.GetSize()] : ""); |
145 |
> |
ext::String entry(jargon.size() ? jargon[random % jargon.size()] : ""); |
146 |
|
|
147 |
|
select(entry); |
148 |
|
} |