Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef MANTID_STRFUNC_SUPPORT_H_
#define MANTID_STRFUNC_SUPPORT_H_
#include "System.h"
#include <iostream>
#include <sstream>
#include <vector>
namespace Mantid
{
/*!
\namespace StrFunc
\brief Holds support functions for strings
\author S. Ansell
\date February 2006
\version 1.0
*/
namespace StrFunc
{
/// determine if a character group exists in a string
DLLExport int confirmStr(const std::string&,const std::string&);
/// Get a word from a string
DLLExport int extractWord(std::string&,const std::string&,const int=4);
/// strip all spaces
DLLExport std::string removeSpace(const std::string&);
/// strip pre/post spaces
DLLExport std::string fullBlock(const std::string&);
/// strip trialling comments
DLLExport void stripComment(std::string&);
/// Determines if a string is only spaces
DLLExport int isEmpty(const std::string&);
/// Get a line and strip comments
DLLExport std::string getLine(std::istream&,const int= 256);
/// get a part of a long line
DLLExport int getPartLine(std::istream&,std::string&,std::string&,const int= 256);
template<typename T> int convPartNum(const std::string&,T&);
/// Convert a string into a number
template<typename T> int convert(const std::string&,T&);
/// Convert a char* into a number
template<typename T> int convert(const char*,T&);
template<typename T>
int setValues(const std::string&,const std::vector<int>&,
std::vector<T>&);
/// Convert and cut a string
template<typename T> int sectPartNum(std::string&,T&);
/// Convert and cut a string
template<typename T> int section(std::string&,T&);
/// Convert and cut a char*
template<typename T> int section(char*,T&);
/// Convert and cut a string for MCNPX
template<typename T> int sectionMCNPX(std::string&,T&);
/// Write file in standard MCNPX input form
void writeMCNPX(const std::string&,std::ostream&);
/// Split tring into spc deliminated components
std::vector<std::string> StrParts(std::string);
/// Write a set of containers to a file
template<template<typename T> class V,typename T>
int writeFile(const std::string&,const T,const V<T>&);
template<template<typename T> class V,typename T>
int writeFile(const std::string&,const V<T>&,const V<T>&);
template<template<typename T> class V,typename T>
int writeFile(const std::string&,const V<T>&,const V<T>&,const V<T>&);
/// Convert a VAX number to x86 little eindien
DLLExport float getVAXnum(const float);
} // NAMESPACE StrFunc
} // NAMESPACE Mantid
#endif //MANTID_STRFUNC_SUPPORT_H_