summaryrefslogtreecommitdiff
path: root/library/RemoteTools.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-17 12:52:22 +0400
committerAlexander Gavrilov2012-03-17 12:52:22 +0400
commit58eb199036db3662ec2f7a2d6d301e7f432d5639 (patch)
treec01d46ab4d403cd900ddbf6e0c31c22946c02a7c /library/RemoteTools.cpp
parent14d6a62e1d212808623f1a71b3c559ac4a8dada3 (diff)
downloaddfhack-58eb199036db3662ec2f7a2d6d301e7f432d5639.tar.gz
dfhack-58eb199036db3662ec2f7a2d6d301e7f432d5639.tar.bz2
dfhack-58eb199036db3662ec2f7a2d6d301e7f432d5639.tar.xz
Add many new template functions for enums & bitfields.
An incompatible change: ENUM_KEY_STR returns std::string now. The old behavior is available via enum_item_key_str function.
Diffstat (limited to 'library/RemoteTools.cpp')
-rw-r--r--library/RemoteTools.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/RemoteTools.cpp b/library/RemoteTools.cpp
index a3e3c9e4..aa632435 100644
--- a/library/RemoteTools.cpp
+++ b/library/RemoteTools.cpp
@@ -61,6 +61,13 @@ using dfproto::CoreTextNotification;
using dfproto::CoreTextFragment;
using google::protobuf::MessageLite;
+void DFHack::strVectorToRepeatedField(RepeatedPtrField<std::string> *pf,
+ const std::vector<std::string> &vec)
+{
+ for (size_t i = 0; i < vec.size(); ++i)
+ *pf->Add() = vec[i];
+}
+
CoreService::CoreService() {
suspend_depth = 0;