summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-29 10:55:03 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-29 10:55:03 -0500
commit61d2f8e4768c0767a64c85aa2b69cfb19d068d61 (patch)
treef1b066f832bd344899b557392d836bc095f9009a
parent3fa8f8764bae2e2fa4d558f6282f1237444147d9 (diff)
Sound and Skin now use CHECK macros
-rw-r--r--sigmod/Skin.cpp23
-rw-r--r--sigmod/Skin.h3
-rw-r--r--sigmod/Sound.cpp36
-rw-r--r--sigmod/Sound.h4
4 files changed, 22 insertions, 44 deletions
diff --git a/sigmod/Skin.cpp b/sigmod/Skin.cpp
index 2721a59a..7cd906fb 100644
--- a/sigmod/Skin.cpp
+++ b/sigmod/Skin.cpp
@@ -74,25 +74,14 @@ QDomElement Sigmod::Skin::save() const
return xml;
}
-void Sigmod::Skin::setName(const QString& name)
-{
- CHECK(name);
-}
+SETTER(Skin, QString&, Name, name)
+SETTER(Skin, Sigcore::Script&, Script, script)
-void Sigmod::Skin::setScript(const Sigcore::Script& script)
-{
- CHECK(script);
-}
+GETTER(Skin, QString, name)
+GETTER(Skin, Sigcore::Script, script)
-QString Sigmod::Skin::name() const
-{
- return m_name;
-}
-
-Sigcore::Script Sigmod::Skin::script() const
-{
- return m_script;
-}
+CHECK(Skin, QString&, name)
+CHECK(Skin, Sigcore::Script&, script)
Sigmod::Skin& Sigmod::Skin::operator=(const Skin& rhs)
{
diff --git a/sigmod/Skin.h b/sigmod/Skin.h
index e7d96a1a..a5369aab 100644
--- a/sigmod/Skin.h
+++ b/sigmod/Skin.h
@@ -50,6 +50,9 @@ class SIGMOD_EXPORT Skin : public Object
QString name() const;
Sigcore::Script script() const;
+ bool nameCheck(const QString& name) const;
+ bool scriptCheck(const Sigcore::Script& script) const;
+
Skin& operator=(const Skin& rhs);
private:
QString m_name;
diff --git a/sigmod/Sound.cpp b/sigmod/Sound.cpp
index ff1f0706..8e6060bf 100644
--- a/sigmod/Sound.cpp
+++ b/sigmod/Sound.cpp
@@ -78,35 +78,17 @@ QDomElement Sigmod::Sound::save() const
return xml;
}
-void Sigmod::Sound::setName(const QString& name)
-{
- CHECK(name);
-}
-
-void Sigmod::Sound::setType(const Type type)
-{
- CHECK(type);
-}
+SETTER(Sound, QString&, Name, name)
+SETTER(Sound, Type, Type, type)
+SETTER(Sound, QByteArray&, Data, data)
-void Sigmod::Sound::setData(const QByteArray& data)
-{
- CHECK(data);
-}
+GETTER(Sound, QString, name)
+GETTER(Sound, Sigmod::Sound::Type, type)
+GETTER(Sound, QByteArray, data)
-QString Sigmod::Sound::name() const
-{
- return m_name;
-}
-
-Sigmod::Sound::Type Sigmod::Sound::type() const
-{
- return m_type;
-}
-
-QByteArray Sigmod::Sound::data() const
-{
- return m_data;
-}
+CHECK(Sound, QString&, name)
+CHECK(Sound, Type, type)
+CHECK(Sound, QByteArray&, data)
Sigmod::Sound& Sigmod::Sound::operator=(const Sound& rhs)
{
diff --git a/sigmod/Sound.h b/sigmod/Sound.h
index 6040a6fb..30b26532 100644
--- a/sigmod/Sound.h
+++ b/sigmod/Sound.h
@@ -61,6 +61,10 @@ class SIGMOD_EXPORT Sound : public Object
Type type() const;
QByteArray data() const;
+ bool nameCheck(const QString& name) const;
+ bool typeCheck(const Type type) const;
+ bool dataCheck(const QByteArray& data) const;
+
Sound& operator=(const Sound& rhs);
private:
QString m_name;