util: Migrated optionalBlankLine from text
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include <Context.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <i18n.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <utf8.h>
|
||||
#include <main.h>
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <ViewText.h>
|
||||
#include <Color.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
#include <main.h>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <ViewText.h>
|
||||
#include <Command.h>
|
||||
#include <ColString.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <i18n.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <i18n.h>
|
||||
#include <format.h>
|
||||
#include <shared.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <main.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <ViewText.h>
|
||||
#include <main.h>
|
||||
#include <format.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
#include <ISO8601.h>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <main.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <cmake.h>
|
||||
#include <CmdLogo.h>
|
||||
#include <Context.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <Context.h>
|
||||
#include <ViewText.h>
|
||||
#include <format.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <Filter.h>
|
||||
#include <ViewText.h>
|
||||
#include <format.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
@@ -43,13 +43,4 @@
|
||||
|
||||
extern Context context;
|
||||
|
||||
static const char* newline = "\n";
|
||||
static const char* noline = "";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const char* optionalBlankLine ()
|
||||
{
|
||||
return context.verbose ("blank") ? newline : noline;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
#include <vector>
|
||||
|
||||
// text.cpp, Non-UTF-8 aware.
|
||||
const char* optionalBlankLine ();
|
||||
int strippedLength (const std::string&);
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
|
||||
extern Context context;
|
||||
|
||||
static const char* newline = "\n";
|
||||
static const char* noline = "";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void signal_handler (int s)
|
||||
{
|
||||
@@ -355,3 +358,9 @@ int strippedLength (const std::string& input)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const char* optionalBlankLine ()
|
||||
{
|
||||
return context.verbose ("blank") ? newline : noline;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -64,6 +64,7 @@ std::string osName ();
|
||||
const std::string obfuscateText (const std::string&);
|
||||
bool nontrivial (const std::string&);
|
||||
int strippedLength (const std::string&);
|
||||
const char* optionalBlankLine ();
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user