Files
Work/avifile/NameValuePair.hpp
2024-08-07 09:12:07 -04:00

66 lines
1.1 KiB
C++

#ifndef _AVIFILE_NAMEVALUE_HPP_
#define _AVIFILE_NAMEVALUE_HPP_
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
class NameValuePair
{
public:
NameValuePair();
NameValuePair(const String &name,const String &value);
const String &getName(void)const;
void setName(const String &name);
const String &getValue(void)const;
void setValue(const String &value);
bool fromString(const String &string);
private:
String mName;
String mValue;
};
inline
NameValuePair::NameValuePair()
{
}
inline
NameValuePair::NameValuePair(const String &name,const String &value)
: mName(name), mValue(value)
{
}
inline
const String &NameValuePair::getName(void)const
{
return mName;
}
inline
void NameValuePair::setName(const String &name)
{
mName=name;
}
inline
const String &NameValuePair::getValue(void)const
{
return mValue;
}
inline
void NameValuePair::setValue(const String &value)
{
mValue=value;
}
inline
bool NameValuePair::fromString(const String &string)
{
if(string.isNull())return false;
mName=string.betweenString(0,'=');
mValue=string.betweenString('=',0);
return true;
}
#endif