26std::string
loadFile(
const std::string &filename) {
30 in.open(filename.c_str());
52std::string
shorten(
const std::string &input,
const size_t max_length) {
53 const std::string ellipsis =
" ... ";
54 const size_t ellipsisSize = ellipsis.size();
56 if ((max_length == 0) || (input.size() < ellipsisSize + 2) || (input.size() <= max_length))
59 const size_t end_length = (max_length - ellipsisSize) / 2;
60 std::string retVal = input.substr(0, end_length) + ellipsis + input.substr(input.size() - end_length, end_length);
72std::string
replace(
const std::string &input,
const std::string &find_what,
const std::string &replace_with) {
73 std::string output = input;
74 std::string::size_type pos = 0;
75 while ((pos = output.find(find_what, pos)) != std::string::npos) {
76 output.erase(pos, find_what.length());
77 output.insert(pos, replace_with);
78 pos += replace_with.length();
90MANTID_KERNEL_DLL std::string
replaceAll(std::string
const &input,
char const to_replace,
char const substitute) {
92 replaced.reserve(input.size());
93 std::transform(input.cbegin(), input.cend(), std::back_inserter(replaced),
94 [to_replace, substitute](
char c) { return (c == to_replace) ? substitute : c; });
107MANTID_KERNEL_DLL std::string
replaceAll(
const std::string &input,
const std::string &charStr,
108 const std::string &substitute) {
109 std::string replaced;
110 replaced.reserve(input.size());
111 std::string::const_iterator iend = input.end();
112 for (std::string::const_iterator itr = input.begin(); itr != iend; ++itr) {
113 char inputChar = (*itr);
114 if (charStr.find_first_of(inputChar) == std::string::npos)
119 replaced.push_back(inputChar);
121 replaced.append(substitute);
129MANTID_KERNEL_DLL std::string
toLower(
const std::string &input) {
130 std::string output(input);
131 std::transform(output.begin(), output.end(), output.begin(), ::tolower);
137MANTID_KERNEL_DLL std::string
toUpper(
const std::string &input) {
138 std::string output(input);
139 std::transform(output.begin(), output.end(), output.begin(), ::toupper);
145MANTID_KERNEL_DLL
bool endsWith(std::string
const &str, std::string
const &suffix) {
146 if (str.size() >= suffix.size()) {
147 return str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
161 std::ios_base::fmtflags PrevFlags = OFS.flags();
167 OFS.flags(PrevFlags);
180 for (
unsigned int i = 0; i <
Line.length(); i++) {
181 if (
Line[i] !=
' ' &&
Line[i] !=
'\t' &&
Line[i] !=
'\r' &&
Line[i] !=
'\n') {
191 if (lastReal <
static_cast<int>(Out.length()))
212 size_t minSize(cnt >
static_cast<int>(Word.size()) ? Word.size() : cnt);
213 std::string::size_type pos =
Line.find(Word.substr(0, minSize));
214 if (pos == std::string::npos)
217 size_t LinePt = minSize + pos;
218 for (; minSize < Word.size() && LinePt <
Line.size() && Word[minSize] ==
Line[LinePt]; LinePt++, minSize++) {
221 Line.erase(pos, LinePt - (pos - 1));
237 auto firstNumber = int(word.size());
238 for (
int i =
int(word.size()) - 1; i >= 0; i--) {
240 if ((c >
'9') || (c <
'0'))
245 if (firstNumber <
int(word.size())) {
246 std::string part = word.substr(firstNumber, word.size() - firstNumber);
261int confirmStr(
const std::string &S,
const std::string &fullPhrase) {
262 const size_t nS(S.length());
263 const size_t nC(fullPhrase.length());
264 if (nS > nC || nS == 0)
266 for (
size_t i = 0; i < nS; i++)
267 if (S[i] != fullPhrase[i])
284int getPartLine(std::istream &fh, std::string &Out, std::string &Excess,
const int spc) {
287 auto ss =
new char[spc + 1];
288 const auto clen =
static_cast<int>(spc - Out.length());
289 fh.getline(ss, clen,
'\n');
291 Out +=
static_cast<std::string
>(ss);
294 std::string::size_type pos = Out.find_first_of(
"#!");
295 if (pos != std::string::npos) {
299 if (fh.gcount() == clen - 1)
301 pos = Out.find_last_of(
"\t ");
302 if (pos != std::string::npos) {
303 Excess = Out.substr(pos, std::string::npos);
306 Excess.erase(0, std::string::npos);
325 for (
char character : CLine) {
326 if (!isspace(character) || prev ==
'\\') {
355 if (std::getline(fh,
Line)) {
357 auto pos =
Line.find_first_of(
"#!");
358 if (pos != std::string::npos)
368 std::streampos pos = fh.tellg();
382 std::string::size_type pos = A.find_first_not_of(
" \t");
383 return (pos != std::string::npos) ? 0 : 1;
393 std::string::size_type posA = A.find(
"$ ");
394 std::string::size_type posB = A.find(
"# ");
395 std::string::size_type posC = A.find(
'!');
400 if (posA != std::string::npos)
401 A.erase(posA, std::string::npos);
419std::string
strip(
const std::string &A) {
420 std::string result(A);
430 A.erase(A.begin(), std::find_if_not(A.begin(), A.end(), ::isspace));
431 A.erase(std::find_if_not(A.rbegin(), A.rend(), ::isspace).base(), A.end());
441 return (line.empty() || line.starts_with(
"#"));
453 const int MaxLine(72);
454 std::string::size_type pos(0);
455 std::string
X =
Line.substr(0, MaxLine);
456 std::string::size_type posB =
X.find_last_of(
" ,");
458 while (posB != std::string::npos &&
static_cast<int>(
X.length()) >= MaxLine - spc) {
460 if (!isspace(
X[posB]))
462 const std::string Out =
X.substr(0, posB);
465 OX << std::string(spc,
' ');
466 OX <<
X.substr(0, posB) <<
'\n';
469 X =
Line.substr(pos, MaxLine - spc);
470 posB =
X.find_last_of(
" ,");
474 OX << std::string(spc,
' ');
485std::vector<std::string>
StrParts(
const std::string &Ln) {
500std::map<std::string, std::string>
splitToKeyValues(
const std::string &input,
const std::string &keyValSep,
501 const std::string &listSep) {
502 std::map<std::string, std::string> keyValues;
503 const int splitOptions =
506 for (
const auto &iter : listSplitter) {
508 if (keyValSplitter.
count() == 2) {
509 keyValues[keyValSplitter[0]] = keyValSplitter[1];
529 int sign, expt, fmask;
534 sign = (Bd.ival & 0x8000) ? -1 : 1;
535 expt = ((Bd.ival & 0x7f80) >> 7);
539 fmask = ((Bd.ival & 0x7f) << 16) | ((Bd.ival & 0xffff0000) >> 16);
542 frac =
static_cast<float>(fmask) / 0x1000000;
543 onum = frac *
static_cast<float>(sign) * pow(2.0, expt);
544 return static_cast<float>(onum);
562 std::istringstream cx;
567 const std::streamoff xpt = cx.tellg();
570 A.erase(0,
static_cast<unsigned int>(xpt));
584template <
typename T>
int section(
char *cA, T &out) {
588 const int item(
section(sA, out));
590 strcpy(cA, sA.c_str());
604template <
typename T>
int section(std::string &A, T &out) {
607 std::istringstream cx;
614 const std::streamoff xpt = cx.tellg();
615 const auto xc =
static_cast<char>(cx.get());
616 if (!cx.fail() && !isspace(xc))
618 A.erase(0,
static_cast<unsigned int>(xpt));
637 std::istringstream cx;
643 const std::streamoff xpt = cx.tellg();
647 const auto xc =
static_cast<char>(cx.get());
648 if (!cx.fail() && !isspace(xc) && (xc !=
'-' || xpt < 5)) {
651 A.erase(0,
static_cast<unsigned int>(xpt));
670template <
typename T>
int convPartNum(
const std::string &A, T &out) {
673 std::istringstream cx;
682 const std::streamoff xpt = cx.tellg();
686 return static_cast<int>(xpt);
696template <
typename T>
int convert(
const std::string &A, T &out) {
699 std::istringstream cx;
706 const auto clast =
static_cast<char>(cx.get());
707 if (!cx.fail() && !isspace(clast))
720template <
typename T>
int convert(
const char *A, T &out) {
735 std::ostringstream mess;
747 std::ostringstream mess;
748 auto it =
value.begin();
749 auto last =
value.end();
752 for (; it != last; ++it) {
755 for (; it != last; ++it) {
758 else if ((stop +
static_cast<T
>(1)) == *(it + 1))
781template <> MANTID_KERNEL_DLL std::string
toString(
const std::vector<std::string> &
value) {
793template <
template <
typename T,
typename A>
class V,
typename T,
typename A>
794int writeFile(
const std::string &Fname,
const T &step,
const V<T, A> &
Y) {
797 for (
unsigned int i = 0; i <
Y.size(); i++)
798 X.emplace_back(i * step);
811template <
template <
typename T,
typename A>
class V,
typename T,
typename A>
812int writeFile(
const std::string &Fname,
const V<T, A> &
X,
const V<T, A> &
Y) {
829template <
template <
typename T,
typename A>
class V,
typename T,
typename A>
830int writeFile(
const std::string &Fname,
const V<T, A> &
X,
const V<T, A> &
Y,
const V<T, A> &Err) {
831 const size_t Npts(
X.size() >
Y.size() ?
Y.size() :
X.size());
832 const size_t Epts(Npts > Err.size() ? Err.size() : Npts);
836 FX.open(Fname.c_str());
840 FX <<
"# " << Npts <<
" " << Epts <<
'\n';
842 FX.setf(std::ios::scientific, std::ios::floatfield);
843 auto xPt =
X.cbegin();
844 auto yPt =
Y.cbegin();
845 auto ePt = (Epts ? Err.cbegin() :
Y.cbegin());
849 for (; eCount < Epts; eCount++) {
850 FX << (*xPt) <<
" " << (*yPt) <<
" " << (*ePt) <<
'\n';
855 for (; eCount < Npts; eCount++) {
856 FX << (*xPt) <<
" " << (*yPt) <<
" 0.0\n";
875template <
typename T>
int setValues(
const std::string &
Line,
const std::vector<int> &Index, std::vector<T> &Out) {
879 if (Out.size() != Index.size())
884 std::string modLine =
Line;
885 std::vector<int> sIndex(Index);
886 std::vector<int> OPt(Index.size());
887 for (
unsigned int i = 0; i < Index.size(); i++)
892 using iVecIter = std::vector<int>::const_iterator;
893 std::vector<int>::const_iterator sc = sIndex.begin();
894 std::vector<int>::const_iterator oc = OPt.begin();
898 while (sc != sIndex.end() && *sc < 0) {
903 while (sc != sIndex.end()) {
906 return static_cast<int>(-1 - distance(
static_cast<iVecIter
>(sIndex.begin()), sc));
912 }
while (sc != sIndex.end() && *sc == cnt);
915 return static_cast<int>(-1 - distance(
static_cast<iVecIter
>(sIndex.begin()), sc));
931std::string
getWord(std::istream &in,
bool consumeEOL) {
937 nextch =
static_cast<char>(in.get());
938 }
while (nextch ==
' ');
941 if (nextch ==
'\n' || nextch ==
'\r') {
944 }
else if ((nextch ==
'\n' && in.peek() ==
'\r') || (nextch ==
'\r' && in.peek() ==
'\n')) {
960 nextch =
static_cast<char>(in.get());
963 if (nextch ==
'\n' || nextch ==
'\r') {
964 if ((nextch ==
'\n' && in.peek() ==
'\r') || (nextch ==
'\r' && in.peek() ==
'\n')) {
983 while (in.good() &&
getWord(in,
false).length() > 0)
1001size_t split_path(
const std::string &path, std::vector<std::string> &path_components) {
1003 path_components.resize(0);
1007 std::string working_path(path);
1008 for (
size_t i = 0; i < path.size(); i++) {
1009 if (working_path[i] < 0x20 || working_path[i] > 0x7E)
1010 working_path[i] =
'_';
1011 if (working_path[i] ==
'\\')
1012 working_path[i] =
'/';
1013 if (working_path[i] ==
' ')
1014 working_path[i] =
'_';
1019 if (path[0] ==
'.') {
1021 std::filesystem::path absol = std::filesystem::absolute(std::filesystem::current_path());
1022 working_path = (absol / working_path).generic_string();
1028 std::list<int64_t> split_pos;
1029 split_pos.emplace_back(-1);
1030 size_t path_size = working_path.size();
1031 for (
size_t i = 0; i < path_size; i++) {
1032 if (working_path[i] ==
'/') {
1033 split_pos.emplace_back(i);
1036 split_pos.emplace_back(path_size);
1038 size_t n_folders = split_pos.size() - 1;
1039 path_components.resize(n_folders);
1040 auto it1 = split_pos.begin();
1045 for (; it2 != split_pos.end(); ++it2) {
1046 std::string folder = working_path.substr(*it1 + 1, *it2 - *it1 - 1);
1047 if (folder.empty() || (folder.size() == 1 && folder ==
".")) {
1052 if (folder ==
"..") {
1055 throw(std::invalid_argument(
"path contains relative references to a "
1056 "folder outside of the seach tree"));
1060 path_components[ic] = folder;
1065 n_folders = size_t(ic);
1066 path_components.resize(n_folders);
1080int isMember(
const std::vector<std::string> &
group,
const std::string &candidate) {
1082 for (
size_t i = 0; i <
group.size(); i++) {
1083 if (candidate ==
group[i]) {
1101std::vector<int>
parseRange(
const std::string &str,
const std::string &elemSep,
const std::string &rangeSep) {
1106 if (elemSep.find(
' ') != std::string::npos) {
1111 Tokenizer ranges(str, rangeSep, Tokenizer::TOK_TRIM);
1112 std::string new_str =
join(ranges.begin(), ranges.end(), rangeSep.substr(0, 1));
1113 elements = Tokenizer(new_str, elemSep, Tokenizer::TOK_IGNORE_EMPTY | Tokenizer::TOK_TRIM);
1115 elements = Tokenizer(str, elemSep, Tokenizer::TOK_IGNORE_EMPTY | Tokenizer::TOK_TRIM);
1118 std::vector<int> result;
1121 result.reserve(elements.count());
1123 for (
const auto &elementString : elements) {
1125 Tokenizer rangeElements(elementString, rangeSep, Tokenizer::TOK_TRIM);
1127 size_t noOfRangeElements = rangeElements.count();
1130 if (noOfRangeElements == 1) {
1132 if (
convert(rangeElements[0], element) != 1)
1133 throw std::invalid_argument(
"Invalid element: " + elementString);
1134 result.emplace_back(element);
1137 else if (noOfRangeElements == 2) {
1140 if (
convert(rangeElements[0], start) != 1 ||
convert(rangeElements[1], end) != 1)
1141 throw std::invalid_argument(
"Invalid range: " + elementString);
1144 throw std::invalid_argument(
"Range boundaries are reversed: " + elementString);
1146 for (
int i = start; i <= end; i++)
1147 result.emplace_back(i);
1151 throw std::invalid_argument(
"Multiple range separators: " + elementString);
1173 c =
static_cast<char>(is.peek());
1179 }
else if (c ==
'\n') {
1191 static const std::string alphabet =
"0123456789abcdefghijklmnopqrstuvwxyz";
1194 result.reserve(len);
1196 while (result.size() != len) {
1197 size_t randPos = ((rand() % (alphabet.size() - 1)));
1198 result.push_back(alphabet[randPos]);
1206 std::size_t
constexpr BUFSIZE{256};
1211 va_start(args, fmt);
1213 int const r = std::vsnprintf(buf, BUFSIZE, fmt, args);
1216 size_t const len(r);
1218 if (len < BUFSIZE) {
1219 res.assign(buf, len);
1221 va_start(args, fmt);
1222 int const r2 = std::vsnprintf(res.data(), len + 1, fmt, args);
1224 if (r2 < 0 ||
static_cast<std::size_t
>(r2) != len) {
1234template MANTID_KERNEL_DLL
int section(std::string &,
double &);
1235template MANTID_KERNEL_DLL
int section(std::string &,
float &);
1236template MANTID_KERNEL_DLL
int section(std::string &,
int &);
1237template MANTID_KERNEL_DLL
int section(std::string &, std::string &);
1239template MANTID_KERNEL_DLL
int sectPartNum(std::string &,
double &);
1240template MANTID_KERNEL_DLL
int sectPartNum(std::string &,
int &);
1241template MANTID_KERNEL_DLL
int sectionMCNPX(std::string &,
double &);
1243template MANTID_KERNEL_DLL
int convert(
const std::string &,
double &);
1244template MANTID_KERNEL_DLL
int convert(
const std::string &,
float &);
1245template MANTID_KERNEL_DLL
int convert(
const std::string &, std::string &);
1246template MANTID_KERNEL_DLL
int convert(
const std::string &,
int &);
1247template MANTID_KERNEL_DLL
int convert(
const std::string &, std::size_t &);
1248template MANTID_KERNEL_DLL
int convert(
const std::string &,
bool &);
1249template MANTID_KERNEL_DLL
int convert(
const char *, std::string &);
1250template MANTID_KERNEL_DLL
int convert(
const char *,
double &);
1251template MANTID_KERNEL_DLL
int convert(
const char *,
int &);
1252template MANTID_KERNEL_DLL
int convert(
const char *, std::size_t &);
1253template MANTID_KERNEL_DLL
int convert(
const char *,
bool &);
1255template MANTID_KERNEL_DLL std::string
toString(
const double &
value);
1256template MANTID_KERNEL_DLL std::string
toString(
const float &
value);
1257template MANTID_KERNEL_DLL std::string
toString(
const int &
value);
1258template MANTID_KERNEL_DLL std::string
toString(
const uint16_t &
value);
1259template MANTID_KERNEL_DLL std::string
toString(
const size_t &
value);
1260#if defined(__APPLE__) || (defined(_WIN32) && !defined(_WIN64)) || \
1261 (defined(__GNUC__) && !defined(__LP64__))
1262template MANTID_KERNEL_DLL std::string
toString(
const uint64_t &
value);
1264template MANTID_KERNEL_DLL std::string
toString(
const std::string &
value);
1266template MANTID_KERNEL_DLL std::string
toString(
const std::vector<int> &
value);
1267template MANTID_KERNEL_DLL std::string
toString(
const std::vector<size_t> &
value);
1270template MANTID_KERNEL_DLL std::string
toString(
const std::set<int> &
value);
1271template MANTID_KERNEL_DLL std::string
toString(
const std::set<int16_t> &
value);
1272template MANTID_KERNEL_DLL std::string
toString(
const std::set<size_t> &
value);
1273#if defined(__APPLE__) || (defined(_WIN32) && !defined(_WIN64)) || \
1274 (defined(__GNUC__) && !defined(__LP64__))
1275template MANTID_KERNEL_DLL std::string
toString(
const std::set<uint64_t> &
value);
1278template MANTID_KERNEL_DLL
int convPartNum(
const std::string &,
double &);
1279template MANTID_KERNEL_DLL
int convPartNum(
const std::string &,
int &);
1281template MANTID_KERNEL_DLL
int setValues(
const std::string &,
const std::vector<int> &, std::vector<double> &);
1283template MANTID_KERNEL_DLL
int writeFile(
const std::string &,
const double &,
const std::vector<double> &);
1284template MANTID_KERNEL_DLL
int writeFile(
const std::string &,
const std::vector<double> &,
const std::vector<double> &,
1285 const std::vector<double> &);
1286template MANTID_KERNEL_DLL
int writeFile(
const std::string &,
const std::vector<double> &,
const std::vector<double> &);
1287template MANTID_KERNEL_DLL
int writeFile(
const std::string &,
const std::vector<float> &,
const std::vector<float> &);
1288template MANTID_KERNEL_DLL
int writeFile(
const std::string &,
const std::vector<float> &,
const std::vector<float> &,
1289 const std::vector<float> &);
double value
The value of the point.
@ TOK_IGNORE_EMPTY
ignore empty tokens
@ TOK_TRIM
remove leading and trailing whitespace from tokens
const TokenVec & asVector()
Returns a vector of tokenized strings.
std::size_t count() const
Get the total number of tokens.
A base-class for the a class that is able to return unit labels in different representations.
Holds support functions for strings.
MANTID_KERNEL_DLL void stripInPlace(std::string &A)
strip pre/post spaces
MANTID_KERNEL_DLL std::string removeSpace(const std::string &CLine)
strip all spaces
MANTID_KERNEL_DLL std::string toLower(const std::string &input)
Converts string to all lowercase.
MANTID_KERNEL_DLL std::istream & extractToEOL(std::istream &is, std::string &str)
Extract a line from input stream, discarding any EOL characters encountered.
MANTID_KERNEL_DLL std::string strmakef(char const *const fmt,...)
This is the constructor that std::string needed to have.
int sectPartNum(std::string &A, T &out)
Convert and cut a string.
MANTID_KERNEL_DLL size_t split_path(const std::string &path, std::vector< std::string > &path_components)
function parses a path, found in input string "path" and returns vector of the folders contributed in...
MANTID_KERNEL_DLL int confirmStr(const std::string &S, const std::string &fullPhrase)
determine if a character group exists in a string
float getVAXnum(const float A)
Convert a VAX number to x86 little eindien.
MANTID_KERNEL_DLL std::vector< int > parseRange(const std::string &str, const std::string &elemSep=",", const std::string &rangeSep="-")
Parses a number range, e.g.
MANTID_KERNEL_DLL std::string strip(const std::string &A)
strip pre/post spaces
MANTID_KERNEL_DLL std::string shorten(const std::string &input, const size_t max_length)
Converts long strings into "start ... end".
int convPartNum(const std::string &A, T &out)
Takes a character string and evaluates the first [typename T] object.
MANTID_KERNEL_DLL int isMember(const std::vector< std::string > &group, const std::string &candidate)
checks if the candidate is the member of the group
DLLExport std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, typename std::enable_if<!(std::is_same< typename std::iterator_traits< ITERATOR_TYPE >::iterator_category, std::random_access_iterator_tag >::value)>::type *=nullptr)
Join a set or vector of (something that turns into a string) together into one string,...
MANTID_KERNEL_DLL std::string replace(const std::string &input, const std::string &find_what, const std::string &replace_with)
Return a string with all matching occurence-strings.
MANTID_KERNEL_DLL std::string randomString(const size_t len)
Generates random alpha-numeric string.
int section(std::string &A, T &out)
Convert and cut a string.
MANTID_KERNEL_DLL std::string peekLine(std::istream &fh)
Peek at a line without extracting it from the stream.
void printHex(std::ostream &OFS, const int n)
Function to convert a number into hex output (and leave the stream un-changed)
MANTID_KERNEL_DLL std::string replaceAll(std::string const &input, char const to_replace, char const substitute)
Return a string with all occurrences of indicated character replaced by the new character.
MANTID_KERNEL_DLL void readToEndOfLine(std::istream &in, bool ConsumeEOL)
Eat everything from the stream until the next EOL.
MANTID_KERNEL_DLL std::string fullBlock(const std::string &A)
strip pre/post spaces
MANTID_KERNEL_DLL bool skipLine(const std::string &line)
Determines if a string starts with a #.
std::string stripMultSpc(const std::string &Line)
Removes the multiple spaces in the line.
int sectionMCNPX(std::string &A, T &out)
Convert and cut a string for MCNPX.
MANTID_KERNEL_DLL std::string loadFile(const std::string &filename)
Loads the entire contents of a text file into a string.
MANTID_KERNEL_DLL std::vector< std::string > StrParts(std::string, const boost::regex &)
Split a line into component parts.
MANTID_KERNEL_DLL std::string toUpper(const std::string &input)
Converts string to all uppercase.
MANTID_KERNEL_DLL bool endsWith(std::string const &str, std::string const &suffix)
Checks if string ends with a suffix.
MANTID_KERNEL_DLL int endsWithInt(const std::string &word)
Get an int from the end of a word.
MANTID_KERNEL_DLL void writeMCNPX(const std::string &Line, std::ostream &OX)
Write file in standard MCNPX input form.
MANTID_KERNEL_DLL std::string getLine(std::istream &fh)
Get a line and strip comments Use only for a single call.
MANTID_KERNEL_DLL void stripComment(std::string &A)
strip trailling comments
MANTID_KERNEL_DLL int extractWord(std::string &Line, const std::string &Word, const int cnt=4)
Get a word from a string.
int convert(const std::string &A, T &out)
Convert a string into a number.
MANTID_KERNEL_DLL std::map< std::string, std::string > splitToKeyValues(const std::string &input, const std::string &keyValSep="=", const std::string &listSep=",")
Splits a string into key value pairs.
int setValues(const std::string &Line, const std::vector< int > &Index, std::vector< T > &Out)
Call to read in various values in position x1,x2,x3 from the line.
MANTID_KERNEL_DLL std::string getWord(std::istream &in, bool consumeEOL)
Returns the next word in the stream.
MANTID_KERNEL_DLL int isEmpty(const std::string &A)
Determines if a string is only spaces.
int writeFile(const std::string &Fname, const T &step, const V< T, A > &Y)
Write a set of containers to a file.
MANTID_KERNEL_DLL int getPartLine(std::istream &fh, std::string &Out, std::string &Excess, const int spc=256)
get a part of a long line
std::string toString(const T &value)
Convert values to strings.