示例#1
0
//
//#############################################################################
//#############################################################################
//
void
MString::ToLower()
{
	MStringRepresentation* old = representation;
	Check_Object(old);
	representation = new MStringRepresentation(*old);
	Register_Object(representation);
	representation->IncrementReferenceCount();
	old->DecrementReferenceCount();
	representation->ToLower();
}
示例#2
0
	// comparison methods
	inline int
		MString::Compare(const MString &str) const
	{
		Check_Object(&str);
		Check_Object(representation);
		return representation->Compare(*str.representation);
   }
示例#3
0
	inline
		MString::MString(const char *cstr)
	{
		representation = new MStringRepresentation(cstr);
		Register_Object(representation);
		representation->IncrementReferenceCount();
		Verify(representation->referenceCount == 1);
	}
示例#4
0
	inline
		MString::MString(const MString &str)
	{
		Check_Object(&str);
		representation = str.representation;
		Check_Object(representation);
		representation->IncrementReferenceCount();
	}
示例#5
0
	inline MString
		MString::GetNthToken(
			size_t nth_token,
			char *delimiters
		) const
	{
		Check_Object(representation);
		MStringRepresentation temp =
			representation->GetNthToken(nth_token, delimiters);
		return MString(temp.stringText);
	}
示例#6
0
	inline size_t
		MString::GetSize() const
	{
		Check_Object(representation);
		return representation->GetSize();
	}
示例#7
0
	inline void
		MString::AllocateLength(size_t length)
	{
		Check_Object(representation);
		representation->AllocateLength(length);
	}
示例#8
0
	inline void
		MString::SetLength(size_t length)
	{
		Check_Object(representation);
		representation->SetLength(length);
	}
示例#9
0
	inline
		MString::~MString()
	{
		Check_Object(representation);
		representation->DecrementReferenceCount();
	}