util: Migrated optionalBlankLine from text

This commit is contained in:
Paul Beckingham 2016-12-11 17:46:06 -05:00
parent eb1e35e84b
commit 87757fb36f
15 changed files with 21 additions and 22 deletions

View file

@ -29,7 +29,7 @@
#include <Context.h> #include <Context.h>
#include <format.h> #include <format.h>
#include <shared.h> #include <shared.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
extern Context context; extern Context context;

View file

@ -35,7 +35,7 @@
#include <i18n.h> #include <i18n.h>
#include <shared.h> #include <shared.h>
#include <format.h> #include <format.h>
#include <text.h> #include <util.h>
#include <utf8.h> #include <utf8.h>
#include <main.h> #include <main.h>

View file

@ -31,7 +31,7 @@
#include <ViewText.h> #include <ViewText.h>
#include <Color.h> #include <Color.h>
#include <shared.h> #include <shared.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
#include <main.h> #include <main.h>

View file

@ -33,7 +33,7 @@
#include <ViewText.h> #include <ViewText.h>
#include <Command.h> #include <Command.h>
#include <ColString.h> #include <ColString.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
extern Context context; extern Context context;

View file

@ -35,7 +35,7 @@
#include <i18n.h> #include <i18n.h>
#include <format.h> #include <format.h>
#include <shared.h> #include <shared.h>
#include <text.h> #include <util.h>
extern Context context; extern Context context;

View file

@ -38,7 +38,7 @@
#include <i18n.h> #include <i18n.h>
#include <format.h> #include <format.h>
#include <shared.h> #include <shared.h>
#include <text.h> #include <util.h>
#include <main.h> #include <main.h>
extern Context context; extern Context context;

View file

@ -32,7 +32,7 @@
#include <ViewText.h> #include <ViewText.h>
#include <main.h> #include <main.h>
#include <format.h> #include <format.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
#include <ISO8601.h> #include <ISO8601.h>

View file

@ -35,7 +35,7 @@
#include <main.h> #include <main.h>
#include <shared.h> #include <shared.h>
#include <format.h> #include <format.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
extern Context context; extern Context context;

View file

@ -27,7 +27,7 @@
#include <cmake.h> #include <cmake.h>
#include <CmdLogo.h> #include <CmdLogo.h>
#include <Context.h> #include <Context.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
extern Context context; extern Context context;

View file

@ -31,7 +31,7 @@
#include <Context.h> #include <Context.h>
#include <ViewText.h> #include <ViewText.h>
#include <format.h> #include <format.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
extern Context context; extern Context context;

View file

@ -33,7 +33,7 @@
#include <Filter.h> #include <Filter.h>
#include <ViewText.h> #include <ViewText.h>
#include <format.h> #include <format.h>
#include <text.h> #include <util.h>
#include <i18n.h> #include <i18n.h>
extern Context context; extern Context context;

View file

@ -43,13 +43,4 @@
extern Context context; extern Context context;
static const char* newline = "\n";
static const char* noline = "";
////////////////////////////////////////////////////////////////////////////////
const char* optionalBlankLine ()
{
return context.verbose ("blank") ? newline : noline;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View file

@ -33,8 +33,6 @@
#include <vector> #include <vector>
// text.cpp, Non-UTF-8 aware. // text.cpp, Non-UTF-8 aware.
const char* optionalBlankLine ();
int strippedLength (const std::string&);
#endif #endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View file

@ -60,6 +60,9 @@
extern Context context; extern Context context;
static const char* newline = "\n";
static const char* noline = "";
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
static void signal_handler (int s) 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;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -64,6 +64,7 @@ std::string osName ();
const std::string obfuscateText (const std::string&); const std::string obfuscateText (const std::string&);
bool nontrivial (const std::string&); bool nontrivial (const std::string&);
int strippedLength (const std::string&); int strippedLength (const std::string&);
const char* optionalBlankLine ();
#endif #endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////