Developer documentation
Version 3.0.3-105-gd3941f44
mrtrix.h File Reference
#include <climits>
#include <cstdio>
#include <cstdarg>
#include <cerrno>
#include <cassert>
#include <sstream>
#include <algorithm>
#include <cctype>
#include <iostream>
#include <array>
#include <string>
#include <cstring>
#include <cstdlib>
#include <limits>
#include <iomanip>
#include "types.h"
#include "exception.h"

Go to the source code of this file.

Classes

struct  MR::max_digits< X, ReturnType >
 
struct  MR::max_digits< X, typename std::enable_if< std::is_fundamental< X >::value, int >::type >
 
struct  MR::max_digits< X, typename std::enable_if< std::is_fundamental< typename X::Scalar >::value, int >::type >
 
struct  MR::max_digits< X, typename std::enable_if< std::is_fundamental< typename X::value_type >::value &&!std::is_fundamental< typename X::Scalar >::value, int >::type >
 

Namespaces

namespace  MR
 

Functions

std::istream & MR::getline (std::istream &stream, std::string &string)
 read a line from the stream More...
 
std::string & MR::add_line (std::string &original, const std::string &new_line)
 add a line to a string, taking care of inserting a newline if needed More...
 
std::string MR::shorten (const std::string &text, size_t longest=40, size_t prefix=10)
 convert a long string to 'beginningofstring...endofstring' for display More...
 
std::string MR::lowercase (const std::string &string)
 return lowercase version of string More...
 
std::string MR::uppercase (const std::string &string)
 return uppercase version of string More...
 
std::string MR::printf (const char *format,...)
 
std::string MR::strip (const std::string &string, const std::string &ws={" \0\t\r\n", 5}, bool left=true, bool right=true)
 
std::string MR::unquote (const std::string &string)
 Remove quotation marks only if surrounding entire string. More...
 
void MR::replace (std::string &string, char orig, char final)
 
void MR::replace (std::string &str, const std::string &from, const std::string &to)
 
vector< std::string > MR::split (const std::string &string, const char *delimiters=" \t\n", bool ignore_empty_fields=false, size_t num=std::numeric_limits< size_t >::max())
 
vector< std::string > MR::split_lines (const std::string &string, bool ignore_empty_fields=true, size_t num=std::numeric_limits< size_t >::max())
 
bool MR::match (const std::string &pattern, const std::string &text, bool ignore_case=false)
 
size_t MR::char_is_dash (const char *arg)
 match a dash or any Unicode character that looks like one More...
 
size_t MR::is_dash (const std::string &arg)
 match whole string to a dash or any Unicode character that looks like one More...
 
bool MR::consume_dash (const char *&arg)
 match current character to a dash or any Unicode character that looks like one More...
 
template<class T >
std::string MR::str (const T &value, int precision=0)
 
template<class T >
MR::to (const std::string &string)
 
template<>
bool MR::to< bool > (const std::string &string)
 
template<>
std::string MR::str< cfloat > (const cfloat &value, int precision)
 
template<>
cfloat MR::to< cfloat > (const std::string &string)
 
template<>
std::string MR::str< cdouble > (const cdouble &value, int precision)
 
template<>
cdouble MR::to< cdouble > (const std::string &string)
 
vector< default_type > MR::parse_floats (const std::string &spec)
 
template<typename IntType >
vector< IntType > MR::parse_ints (const std::string &spec, const IntType last=std::numeric_limits< IntType >::max())
 
std::string MR::join (const vector< std::string > &V, const std::string &delimiter)
 
template<typename T >
std::string MR::join (const vector< T > &V, const std::string &delimiter)
 
std::string MR::join (const char *const *null_terminated_array, const std::string &delimiter)