mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
- Added DEVELOPERS file describing high-level code layout.
- Removed unused library.h file. - Removed unused std::wstring Unicode variants.
This commit is contained in:
parent
4825b37df5
commit
4549af6b84
6 changed files with 23 additions and 79 deletions
|
@ -1,49 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2004 - 2008, Paul Beckingham. All rights reserved.
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef INCLUDED_LIBRARY
|
||||
#define INCLUDED_LIBRARY
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "stlmacros.h"
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
// text.cpp
|
||||
void wrapText (std::vector <std::string>&, const std::string&, const int);
|
||||
std::string trimLeft (const std::string& in, const std::string& t = " ");
|
||||
std::string trimRight (const std::string& in, const std::string& t = " ");
|
||||
std::string trim (const std::string& in, const std::string& t = " ");
|
||||
std::wstring trimLeft (const std::wstring& in, const std::wstring& t = L" "); // UNICODE safe
|
||||
std::wstring trimRight (const std::wstring& in, const std::wstring& t = L" "); // UNICODE safe
|
||||
std::wstring trim (const std::wstring& in, const std::wstring& t = L" "); // UNICODE safe
|
||||
void extractParagraphs (const std::string&, std::vector<std::string>&);
|
||||
void extractLine (std::string&, std::string&, int);
|
||||
void split (std::vector<std::string>&, const std::string&, const char);
|
||||
void split (std::vector<std::string>&, const std::string&, const std::string&);
|
||||
void join (std::string&, const std::string&, const std::vector<std::string>&);
|
||||
std::string commify (const std::string&);
|
||||
std::string lowerCase (const std::string&);
|
||||
|
||||
// misc.cpp
|
||||
void delay (float);
|
||||
|
||||
// list.cpp
|
||||
int autoComplete (const std::string&, const std::vector<std::string>&, std::vector<std::string>&);
|
||||
|
||||
// units.cpp
|
||||
void formatTimeDeltaDays (std::string&, time_t);
|
||||
std::string formatSeconds (time_t);
|
||||
|
||||
// uuid.cpp
|
||||
const std::string uuid ();
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -57,9 +57,6 @@ void wrapText (std::vector <std::string>&, const std::string&, const int);
|
|||
std::string trimLeft (const std::string& in, const std::string& t = " ");
|
||||
std::string trimRight (const std::string& in, const std::string& t = " ");
|
||||
std::string trim (const std::string& in, const std::string& t = " ");
|
||||
std::wstring trimLeft (const std::wstring& in, const std::wstring& t = L" "); // UNICODE safe
|
||||
std::wstring trimRight (const std::wstring& in, const std::wstring& t = L" "); // UNICODE safe
|
||||
std::wstring trim (const std::wstring& in, const std::wstring& t = L" "); // UNICODE safe
|
||||
void extractParagraphs (const std::string&, std::vector<std::string>&);
|
||||
void extractLine (std::string&, std::string&, int);
|
||||
void split (std::vector<std::string>&, const std::string&, const char);
|
||||
|
|
21
src/text.cpp
21
src/text.cpp
|
@ -99,13 +99,6 @@ std::string trimLeft (const std::string& in, const std::string& t /*= " "*/)
|
|||
return out.erase (0, in.find_first_not_of (t));
|
||||
}
|
||||
|
||||
// UNICODE safe
|
||||
std::wstring trimLeft (const std::wstring& in, const std::wstring& t /*= L" "*/)
|
||||
{
|
||||
std::wstring out = in;
|
||||
return out.erase (0, in.find_first_not_of (t));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string trimRight (const std::string& in, const std::string& t /*= " "*/)
|
||||
{
|
||||
|
@ -113,13 +106,6 @@ std::string trimRight (const std::string& in, const std::string& t /*= " "*/)
|
|||
return out.erase (out.find_last_not_of (t) + 1);
|
||||
}
|
||||
|
||||
// UNICODE safe
|
||||
std::wstring trimRight (const std::wstring& in, const std::wstring& t /*= L" "*/)
|
||||
{
|
||||
std::wstring out = in;
|
||||
return out.erase (out.find_last_not_of (t) + 1);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string trim (const std::string& in, const std::string& t /*= " "*/)
|
||||
{
|
||||
|
@ -127,13 +113,6 @@ std::string trim (const std::string& in, const std::string& t /*= " "*/)
|
|||
return trimLeft (trimRight (out, t), t);
|
||||
}
|
||||
|
||||
// UNICODE safe
|
||||
std::wstring trim (const std::wstring& in, const std::wstring& t /*= L" "*/)
|
||||
{
|
||||
std::wstring out = in;
|
||||
return trimLeft (trimRight (out, t), t);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Remove enclosing balanced quotes. Assumes trimmed text.
|
||||
void unquoteText (std::string& text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue