util: Migrated nontrivial from text
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
#include <Timer.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
12
src/text.cpp
12
src/text.cpp
@@ -52,18 +52,6 @@ const char* optionalBlankLine ()
|
||||
return context.verbose ("blank") ? newline : noline;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool nontrivial (const std::string& input)
|
||||
{
|
||||
std::string::size_type i = 0;
|
||||
int character;
|
||||
while ((character = utf8_next_char (input, i)))
|
||||
if (! Lexer::isWhitespace (character))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Return the length, in characters, of the input, subtracting color control
|
||||
// codes.
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
// text.cpp, Non-UTF-8 aware.
|
||||
const char* optionalBlankLine ();
|
||||
bool nontrivial (const std::string&);
|
||||
int strippedLength (const std::string&);
|
||||
|
||||
#endif
|
||||
|
||||
12
src/util.cpp
12
src/util.cpp
@@ -316,3 +316,15 @@ const std::string obfuscateText (const std::string& input)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool nontrivial (const std::string& input)
|
||||
{
|
||||
std::string::size_type i = 0;
|
||||
int character;
|
||||
while ((character = utf8_next_char (input, i)))
|
||||
if (! Lexer::isWhitespace (character))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -62,6 +62,7 @@ const std::vector <std::string> extractParents (
|
||||
|
||||
std::string osName ();
|
||||
const std::string obfuscateText (const std::string&);
|
||||
bool nontrivial (const std::string&);
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user