util/SplitString: rename to DivideString
This commit is contained in:
parent
90e6c727da
commit
050f0c3d8f
@ -374,7 +374,7 @@ libutil_a_SOURCES = \
|
||||
src/util/CharUtil.hxx \
|
||||
src/util/NumberParser.hxx \
|
||||
src/util/StringUtil.cxx src/util/StringUtil.hxx \
|
||||
src/util/SplitString.cxx src/util/SplitString.hxx \
|
||||
src/util/DivideString.cxx src/util/DivideString.hxx \
|
||||
src/util/FormatString.cxx src/util/FormatString.hxx \
|
||||
src/util/Tokenizer.cxx src/util/Tokenizer.hxx \
|
||||
src/util/TextFile.hxx \
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "tag/MixRamp.hxx"
|
||||
#include "ReplayGainInfo.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
#include "util/SplitString.hxx"
|
||||
#include "util/DivideString.hxx"
|
||||
|
||||
bool
|
||||
flac_parse_replay_gain(ReplayGainInfo &rgi,
|
||||
@ -97,7 +97,7 @@ flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||
{
|
||||
if (handler->pair != nullptr) {
|
||||
const char *comment = (const char *)entry->entry;
|
||||
const SplitString split(comment, '=');
|
||||
const DivideString split(comment, '=');
|
||||
if (split.IsDefined() && !split.IsEmpty())
|
||||
tag_handler_invoke_pair(handler, handler_ctx,
|
||||
split.GetFirst(),
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "tag/ReplayGain.hxx"
|
||||
#include "ReplayGainInfo.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
#include "util/SplitString.hxx"
|
||||
#include "util/DivideString.hxx"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
@ -74,7 +74,7 @@ vorbis_scan_comment(const char *comment,
|
||||
const struct tag_handler *handler, void *handler_ctx)
|
||||
{
|
||||
if (handler->pair != nullptr) {
|
||||
const SplitString split(comment, '=');
|
||||
const DivideString split(comment, '=');
|
||||
if (split.IsDefined() && !split.IsEmpty())
|
||||
tag_handler_invoke_pair(handler, handler_ctx,
|
||||
split.GetFirst(),
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "config.h"
|
||||
#include "AoOutputPlugin.hxx"
|
||||
#include "../OutputAPI.hxx"
|
||||
#include "util/SplitString.hxx"
|
||||
#include "util/DivideString.hxx"
|
||||
#include "util/Error.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "Log.hxx"
|
||||
@ -130,7 +130,7 @@ AoOutput::Configure(const config_param ¶m, Error &error)
|
||||
gchar **_options = g_strsplit(value, ";", 0);
|
||||
|
||||
for (unsigned i = 0; _options[i] != nullptr; ++i) {
|
||||
const SplitString ss(_options[i], '=');
|
||||
const DivideString ss(_options[i], '=');
|
||||
|
||||
if (!ss.IsDefined()) {
|
||||
error.Format(ao_output_domain,
|
||||
|
@ -17,11 +17,11 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "SplitString.hxx"
|
||||
#include "DivideString.hxx"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
SplitString::SplitString(const char *s, char separator)
|
||||
DivideString::DivideString(const char *s, char separator)
|
||||
:first(nullptr)
|
||||
{
|
||||
const char *x = strchr(s, separator);
|
@ -17,8 +17,8 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef MPD_SPLIT_STRING_HXX
|
||||
#define MPD_SPLIT_STRING_HXX
|
||||
#ifndef MPD_DIVIDE_STRING_HXX
|
||||
#define MPD_DIVIDE_STRING_HXX
|
||||
|
||||
#include "Compiler.h"
|
||||
|
||||
@ -28,14 +28,14 @@
|
||||
* Split a given constant string at a separator character. Duplicates
|
||||
* the first part to be able to null-terminate it.
|
||||
*/
|
||||
class SplitString {
|
||||
class DivideString {
|
||||
char *first;
|
||||
const char *second;
|
||||
|
||||
public:
|
||||
SplitString(const char *s, char separator);
|
||||
DivideString(const char *s, char separator);
|
||||
|
||||
~SplitString() {
|
||||
~DivideString() {
|
||||
delete[] first;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user