/usr/include/ThePEG/Utilities/StringUtils.h is in libthepeg-dev 1.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | // -*- C++ -*-
//
// StringUtils.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef ThePEG_StringUtils_H
#define ThePEG_StringUtils_H
// This is the declaration of the StringUtils class.
#include "ThePEG/Config/ThePEG.h"
namespace ThePEG {
/**
* The StringUtils class contains a few static utility functions for
* basic strings.
*/
class StringUtils {
public:
/**
* A vector of strings.
*/
typedef vector<string> StringVector;
/**
* Return a vector of string containing the substrings of s, defined
* by the separating characters in ws (the ws characters are not
* included in the substrings.
*/
static StringVector split(string s, string ws = " \t\r\n");
/**
* Return the first substring of s, defined by the separating
* characters in ws (the ws characters are not included in the
* substrings.
*/
static string car(string s, string ws = " \t\r\n");
/**
* Return s after removing the first substring, defined by the
* separating characters in ws (the ws characters are not included
* in the substrings.
*/
static string cdr(string s, string ws = " \t\r\n");
/**
* Return the string \a str stripped from leading and trailing white
* space.
*/
static string stripws(string str);
/**
* Return the directory path part (excluding the trailing slash) of
* the given filename, or an empty string if no directory path is
* included
*/
static string dirname(string file);
/**
* Return the base name of the given filename, removing the
* directory path if present.
*/
static string basename(string file);
/**
* Remove the trailing suffix from the given filename.
*/
static string remsuf(string file);
/**
* Return the trailing suffix (without the dot) of the given
* filename.
*/
static string suffix(string file);
/**
* Assuming the \a line contains a valid XML \a tag, scan the \a
* line for attributes belonging to this \a tag and return a map of
* name-value pairs. Oprionally only look from position \a curr in
* the \a line.
*/
static map<string,string> xmlAttributes(string tag, string line,
string::size_type curr = 0);
/**
* Try to return a human-readable class name given a type_info
* object. Currently only works for simple classes compiled by g++.
*/
static string typeName(const type_info & t);
/**
* Convenient typdef.
*/
typedef string::size_type pos_t;
/**
* Convenient alias for npos.
*/
static const pos_t end = string::npos;
};
}
#endif /* ThePEG_StringUtils_H */
|