Skip to content
Snippets Groups Projects
Commit daa0c564 authored by Stuart Ansell's avatar Stuart Ansell
Browse files

re #35

Start of the big Geometry::Volume checkin.
Modifications to dependent files (added functionality) 
parent 473ee894
No related branches found
No related tags found
No related merge requests found
#ifndef MANTID_STRFUNC_SUPPORT_H_ #ifndef MANTID_STRFUNC_SUPPORT_H_
#define MANTID_STRFUNC_SUPPORT_H_ #define MANTID_STRFUNC_SUPPORT_H_
#include "System.h" #include "System.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
namespace Mantid namespace Mantid
{ {
/*! /*!
\namespace StrFunc \namespace StrFunc
\brief Holds support functions for strings \brief Holds support functions for strings
\author S. Ansell \author S. Ansell
\date February 2006 \date February 2006
\version 1.0 \version 1.0
*/ */
namespace StrFunc namespace StrFunc
{ {
/// determine if a character group exists in a string /// determine if a character group exists in a string
DLLExport int confirmStr(const std::string&,const std::string&); DLLExport int confirmStr(const std::string&,const std::string&);
/// Get a word from a string /// Get a word from a string
DLLExport int extractWord(std::string&,const std::string&,const int=4); DLLExport int extractWord(std::string&,const std::string&,const int=4);
/// strip all spaces /// strip all spaces
DLLExport std::string removeSpace(const std::string&); DLLExport std::string removeSpace(const std::string&);
/// strip pre/post spaces /// strip pre/post spaces
DLLExport std::string fullBlock(const std::string&); DLLExport std::string fullBlock(const std::string&);
/// strip trialling comments /// strip trialling comments
DLLExport void stripComment(std::string&); DLLExport void stripComment(std::string&);
/// Determines if a string is only spaces /// Determines if a string is only spaces
DLLExport int isEmpty(const std::string&); DLLExport int isEmpty(const std::string&);
/// Get a line and strip comments /// Get a line and strip comments
DLLExport std::string getLine(std::istream&,const int= 256); DLLExport std::string getLine(std::istream&,const int= 256);
/// get a part of a long line /// get a part of a long line
DLLExport int getPartLine(std::istream&,std::string&,std::string&,const int= 256); DLLExport int getPartLine(std::istream&,std::string&,std::string&,const int= 256);
template<typename T> int convPartNum(const std::string&,T&); template<typename T> int convPartNum(const std::string&,T&);
/// Convert a string into a number /// Convert a string into a number
template<typename T> int convert(const std::string&,T&); template<typename T> int convert(const std::string&,T&);
/// Convert a char* into a number /// Convert a char* into a number
template<typename T> int convert(const char*,T&); template<typename T> int convert(const char*,T&);
/// Convert and cut a string
template<typename T> int sectPartNum(std::string&,T&); template<typename T>
int setValues(const std::string&,const std::vector<int>&,
/// Convert and cut a string std::vector<T>&);
template<typename T> int section(std::string&,T&);
/// Convert and cut a char* /// Convert and cut a string
template<typename T> int section(char*,T&); template<typename T> int sectPartNum(std::string&,T&);
/// Convert and cut a string for MCNPX /// Convert and cut a string
template<typename T> int sectionMCNPX(std::string&,T&); template<typename T> int section(std::string&,T&);
/// Convert and cut a char*
/// Convert a VAX number to x86 little eindien template<typename T> int section(char*,T&);
DLLExport float getVAXnum(const float);
/// Convert and cut a string for MCNPX
} template<typename T> int sectionMCNPX(std::string&,T&);
}
/// Write file in standard MCNPX input form
#endif //MANTID_STRFUNC_SUPPORT_H_ 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_
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment