diff options
Diffstat (limited to 'src/messageparser.cc')
| -rw-r--r-- | src/messageparser.cc | 17 | 
1 files changed, 16 insertions, 1 deletions
| diff --git a/src/messageparser.cc b/src/messageparser.cc index 0f1844e..7393c5c 100644 --- a/src/messageparser.cc +++ b/src/messageparser.cc @@ -352,13 +352,28 @@ std::vector<std::string> msg_tostring(message_t m)  			std::to_string(m.create.parentid) + " " +  			std::to_string(m.create.insertbeforeid) + ";";  		msgs.push_back(msg); -		for(const auto& attribute : m.attributes) +		for(const auto& attribute : m.create.attributes)  		{  			msg = "update " +  				std::to_string(m.create.id) + " \"" +  				attribute.first + "\" \"" + attribute.second + "\";";  			msgs.push_back(msg);  		} +		for(const auto &child : m.create.children) +		{ +			msg = "create " + +				std::to_string(child.id) + " " + +				std::to_string(child.parentid) + " " + +				std::to_string(child.insertbeforeid) + ";"; +			msgs.push_back(msg); +			for(const auto& attribute : child.attributes) +			{ +				msg = "update " + +					std::to_string(child.id) + " \"" + +					attribute.first + "\" \"" + attribute.second + "\";"; +				msgs.push_back(msg); +			} +		}  		break;  	case cmd::remove:  		msg = "remove " + std::to_string(m.remove.id) + ";"; | 
