Go to the source code of this file.
Namespaces | |
| MooseUtils | |
Functions | |
| std::filesystem::path | MooseUtils::pathjoin (const std::filesystem::path &p) |
| std::string | MooseUtils::runTestsExecutable () |
| Returns the location of either a local repo run_tests script - or an installed test executor script if run_tests isn't found. More... | |
| std::string | MooseUtils::findTestRoot () |
| Searches in the current working directory and then recursively up in each parent directory looking for a "testroot" file. More... | |
| bool | MooseUtils::parsesToReal (const std::string &input, Real *parsed_real=nullptr) |
| Check if the input string can be parsed into a Real. More... | |
| std::string | MooseUtils::installedInputsDir (const std::string &app_name, const std::string &dir_name, const std::string &extra_error_msg="") |
| Returns the directory of any installed inputs or the empty string if none are found. More... | |
| std::string | MooseUtils::docsDir (const std::string &app_name) |
| Returns the directory of any installed docs/site. More... | |
| std::string | MooseUtils::mooseDocsURL (const std::string &path) |
| Returns the URL of a page located on the MOOSE documentation site. More... | |
| std::string | MooseUtils::replaceAll (std::string str, const std::string &from, const std::string &to) |
| Replaces all occurrences of from in str with to and returns the result. More... | |
| std::string | MooseUtils::convertLatestCheckpoint (std::string orig) |
| Replaces "LATEST" placeholders with the latest checkpoint file name. More... | |
| int | MooseUtils::levenshteinDist (const std::string &s1, const std::string &s2) |
| Computes and returns the Levenshtein distance between strings s1 and s2. More... | |
| void | MooseUtils::escape (std::string &str) |
| This function will escape all of the standard C++ escape characters so that they can be printed. More... | |
| std::string | MooseUtils::removeExtraWhitespace (const std::string &str) |
| Removes additional whitespace from a string. More... | |
| bool | MooseUtils::pathContains (const std::string &expression, const std::string &string_to_find, const std::string &delims="/") |
| This function tokenizes a path and checks to see if it contains the string to look for. More... | |
| bool | MooseUtils::pathExists (const std::string &path) |
| bool | MooseUtils::checkFileReadable (const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true) |
| Checks to see if a file is readable (exists and permissions) More... | |
| bool | MooseUtils::checkForGitLFSPointer (std::ifstream &file) |
| Check if the file is a Git-LFS pointer. More... | |
| bool | MooseUtils::checkFileWriteable (const std::string &filename, bool throw_on_unwritable=true) |
| Check if the file is writable (path exists and permissions) More... | |
| void | MooseUtils::parallelBarrierNotify (const libMesh::Parallel::Communicator &comm, bool messaging=true) |
| This function implements a parallel barrier function but writes progress to stdout. More... | |
| void | MooseUtils::serialBegin (const libMesh::Parallel::Communicator &comm, bool warn=true) |
| This function marks the begin of a section of code that is executed in serial rank by rank. More... | |
| void | MooseUtils::serialEnd (const libMesh::Parallel::Communicator &comm, bool warn=true) |
| Closes a section of code that is executed in serial rank by rank, and that was opened with a call to serialBegin. More... | |
| bool | MooseUtils::hasExtension (const std::string &filename, std::string ext, bool strip_exodus_ext=false) |
| Function tests if the supplied filename as the desired extension. More... | |
| std::string | MooseUtils::getExtension (const std::string &filename, const bool rfind=false) |
| Gets the extension of the passed file name. More... | |
| std::string | MooseUtils::stripExtension (const std::string &s, const bool rfind=false) |
| Removes any file extension from the given string s (i.e. More... | |
| std::string | MooseUtils::getCurrentWorkingDir () |
| Returns the current working directory as a string. More... | |
| void | MooseUtils::makedirs (const std::string &dir_name, bool throw_on_failure=false) |
| Recursively make directories. More... | |
| void | MooseUtils::removedirs (const std::string &dir_name, bool throw_on_failure=false) |
| Recursively remove directories from inner-most when the directories are empty. More... | |
| std::string | MooseUtils::camelCaseToUnderscore (const std::string &camel_case_name) |
| Function for converting a camel case name to a name containing underscores. More... | |
| std::string | MooseUtils::underscoreToCamelCase (const std::string &underscore_name, bool leading_upper_case) |
| Function for converting an underscore name to a camel case name. More... | |
| std::string | MooseUtils::shortName (const std::string &name) |
| Function for stripping name after the file / in parser block. More... | |
| std::string | MooseUtils::baseName (const std::string &name) |
| Function for string the information before the final / in a parser block. More... | |
| std::string | MooseUtils::hostname () |
| Get the hostname the current process is running on. More... | |
| unsigned short | MooseUtils::getTermWidth (bool use_environment) |
| Returns the width of the terminal using sys/ioctl. More... | |
| void | MooseUtils::MaterialPropertyStorageDump (const HashMap< const libMesh::Elem *, HashMap< unsigned int, MaterialProperties >> &props) |
| Function to dump the contents of MaterialPropertyStorage for debugging purposes. More... | |
| std::string & | MooseUtils::removeColor (std::string &msg) |
| remove ANSI escape sequences for terminal color from msg More... | |
| void | MooseUtils::addLineBreaks (std::string &message, unsigned int line_width) |
| void | MooseUtils::indentMessage (const std::string &prefix, std::string &message, const char *color=COLOR_CYAN, bool dont_indent_first_line=true, const std::string &post_prefix=": ") |
| Indents the supplied message given the prefix and color. More... | |
| std::list< std::string > | MooseUtils::listDir (const std::string path, bool files_only=false) |
| std::list< std::string > | MooseUtils::getFilesInDirs (const std::list< std::string > &directory_list, const bool files_only=true) |
| Retrieves the names of all of the files contained within the list of directories passed into the routine. More... | |
| std::string | MooseUtils::getLatestCheckpointFilePrefix (const std::list< std::string > &checkpoint_files) |
| Returns the most recent checkpoint prefix (the four numbers at the beginning) If a suitable file isn't found the empty string is returned. More... | |
| bool | MooseUtils::wildCardMatch (std::string name, std::string search_string) |
| bool | MooseUtils::globCompare (const std::string &candidate, const std::string &pattern, std::size_t c=0, std::size_t p=0) |
| std::string | MooseUtils::stringJoin (const std::vector< std::string > &values, const std::string &separator=" ") |
Concatenates value into a single string separated by separator. More... | |
| bool | MooseUtils::beginsWith (const std::string &value, const std::string &begin_value) |
| ExecFlagEnum | MooseUtils::getDefaultExecFlagEnum () |
| Return the default ExecFlagEnum for MOOSE. More... | |
| int | MooseUtils::stringToInteger (const std::string &input, bool throw_on_failure=false) |
| Robust string to integer conversion that fails for cases such at "1foo". More... | |
| void | MooseUtils::linearPartitionItems (dof_id_type num_items, dof_id_type num_chunks, dof_id_type chunk_id, dof_id_type &num_local_items, dof_id_type &local_items_begin, dof_id_type &local_items_end) |
| Linearly partition a number of items. More... | |
| processor_id_type | MooseUtils::linearPartitionChunk (dof_id_type num_items, dof_id_type num_chunks, dof_id_type item_id) |
| Return the chunk_id that is assigned to handle item_id. More... | |
| std::vector< std::string > | MooseUtils::split (const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max()) |
| Python like split functions for strings. More... | |
| std::vector< std::string > | MooseUtils::rsplit (const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max()) |
| void | MooseUtils::createSymlink (const std::string &target, const std::string &link) |
| Create a symbolic link, if the link already exists it is replaced. More... | |
| void | MooseUtils::clearSymlink (const std::string &link) |
| Remove a symbolic link, if the given filename is a link. More... | |
| std::size_t | MooseUtils::fileSize (const std::string &filename) |
| Check the file size. More... | |
| std::string | MooseUtils::realpath (const std::string &path) |
| Wrapper around PetscGetRealPath, which is a cross-platform replacement for realpath. More... | |
| libMesh::BoundingBox | MooseUtils::buildBoundingBox (const Point &p1, const Point &p2) |
| Construct a valid bounding box from 2 arbitrary points. More... | |
| std::string | MooseUtils::prettyCppType (const std::string &cpp_type) |
| std::string | MooseUtils::canonicalPath (const std::string &path) |
| Gets the canonical path of the given path. More... | |
| bool | MooseUtils::startsWith (const std::string &string1, const std::string &string2) |
| void | MooseUtils::replaceStart (std::string &string1, const std::string &string2, const std::string &string3) |
Replace the starting string string2 of string1 with string3. More... | |
| bool | MooseUtils::isAllLowercase (const std::string &str) |
| void | removeSubstring (std::string &main, const std::string &sub) |
| find, erase, length algorithm for removing a substring from a string More... | |
| std::string | removeSubstring (const std::string &main, const std::string &sub) |
| find, erase, length algorithm for removing a substring from a copy of a string More... | |
| void removeSubstring | ( | std::string & | main, |
| const std::string & | sub | ||
| ) |
find, erase, length algorithm for removing a substring from a string
Definition at line 1201 of file MooseUtils.C.
Referenced by FEProblemBase::checkDependMaterialsHelper(), and SubProblem::initialSetup().
| std::string removeSubstring | ( | const std::string & | main, |
| const std::string & | sub | ||
| ) |
find, erase, length algorithm for removing a substring from a copy of a string
Definition at line 1209 of file MooseUtils.C.
1.8.14