util/SplitString: rename to DivideString

This commit is contained in:
Max Kellermann 2014-12-03 21:38:06 +01:00
parent 90e6c727da
commit 050f0c3d8f
6 changed files with 14 additions and 14 deletions

View File

@ -374,7 +374,7 @@ libutil_a_SOURCES = \
src/util/CharUtil.hxx \ src/util/CharUtil.hxx \
src/util/NumberParser.hxx \ src/util/NumberParser.hxx \
src/util/StringUtil.cxx src/util/StringUtil.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/FormatString.cxx src/util/FormatString.hxx \
src/util/Tokenizer.cxx src/util/Tokenizer.hxx \ src/util/Tokenizer.cxx src/util/Tokenizer.hxx \
src/util/TextFile.hxx \ src/util/TextFile.hxx \

View File

@ -30,7 +30,7 @@
#include "tag/MixRamp.hxx" #include "tag/MixRamp.hxx"
#include "ReplayGainInfo.hxx" #include "ReplayGainInfo.hxx"
#include "util/ASCII.hxx" #include "util/ASCII.hxx"
#include "util/SplitString.hxx" #include "util/DivideString.hxx"
bool bool
flac_parse_replay_gain(ReplayGainInfo &rgi, flac_parse_replay_gain(ReplayGainInfo &rgi,
@ -97,7 +97,7 @@ flac_scan_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
{ {
if (handler->pair != nullptr) { if (handler->pair != nullptr) {
const char *comment = (const char *)entry->entry; const char *comment = (const char *)entry->entry;
const SplitString split(comment, '='); const DivideString split(comment, '=');
if (split.IsDefined() && !split.IsEmpty()) if (split.IsDefined() && !split.IsEmpty())
tag_handler_invoke_pair(handler, handler_ctx, tag_handler_invoke_pair(handler, handler_ctx,
split.GetFirst(), split.GetFirst(),

View File

@ -27,7 +27,7 @@
#include "tag/ReplayGain.hxx" #include "tag/ReplayGain.hxx"
#include "ReplayGainInfo.hxx" #include "ReplayGainInfo.hxx"
#include "util/ASCII.hxx" #include "util/ASCII.hxx"
#include "util/SplitString.hxx" #include "util/DivideString.hxx"
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@ -74,7 +74,7 @@ vorbis_scan_comment(const char *comment,
const struct tag_handler *handler, void *handler_ctx) const struct tag_handler *handler, void *handler_ctx)
{ {
if (handler->pair != nullptr) { if (handler->pair != nullptr) {
const SplitString split(comment, '='); const DivideString split(comment, '=');
if (split.IsDefined() && !split.IsEmpty()) if (split.IsDefined() && !split.IsEmpty())
tag_handler_invoke_pair(handler, handler_ctx, tag_handler_invoke_pair(handler, handler_ctx,
split.GetFirst(), split.GetFirst(),

View File

@ -20,7 +20,7 @@
#include "config.h" #include "config.h"
#include "AoOutputPlugin.hxx" #include "AoOutputPlugin.hxx"
#include "../OutputAPI.hxx" #include "../OutputAPI.hxx"
#include "util/SplitString.hxx" #include "util/DivideString.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"
#include "Log.hxx" #include "Log.hxx"
@ -130,7 +130,7 @@ AoOutput::Configure(const config_param &param, Error &error)
gchar **_options = g_strsplit(value, ";", 0); gchar **_options = g_strsplit(value, ";", 0);
for (unsigned i = 0; _options[i] != nullptr; ++i) { for (unsigned i = 0; _options[i] != nullptr; ++i) {
const SplitString ss(_options[i], '='); const DivideString ss(_options[i], '=');
if (!ss.IsDefined()) { if (!ss.IsDefined()) {
error.Format(ao_output_domain, error.Format(ao_output_domain,

View File

@ -17,11 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "SplitString.hxx" #include "DivideString.hxx"
#include <string.h> #include <string.h>
SplitString::SplitString(const char *s, char separator) DivideString::DivideString(const char *s, char separator)
:first(nullptr) :first(nullptr)
{ {
const char *x = strchr(s, separator); const char *x = strchr(s, separator);

View File

@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_SPLIT_STRING_HXX #ifndef MPD_DIVIDE_STRING_HXX
#define MPD_SPLIT_STRING_HXX #define MPD_DIVIDE_STRING_HXX
#include "Compiler.h" #include "Compiler.h"
@ -28,14 +28,14 @@
* Split a given constant string at a separator character. Duplicates * Split a given constant string at a separator character. Duplicates
* the first part to be able to null-terminate it. * the first part to be able to null-terminate it.
*/ */
class SplitString { class DivideString {
char *first; char *first;
const char *second; const char *second;
public: public:
SplitString(const char *s, char separator); DivideString(const char *s, char separator);
~SplitString() { ~DivideString() {
delete[] first; delete[] first;
} }