summaryrefslogtreecommitdiff
path: root/starts/biscuit/simple_recv.cpp
blob: 4f82ab35849521a6d3cf27a20ce0f749ee59162f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// receives information as a text line on stdin
// works on StringValue 'text'

#include <opencog/atomspace/Handle.h>
#include <iostream>

extern "C" void simple_recv(opencog::Handle data)
{
	std::string s(4096);
	std::cin.getline(&s[0], s.size(), std::endl);
	opencog::Handle text = data.getAtomSpace()->add_node(opencog::STRING_VALUE, "text");
	data.setValue(text, new opencog::StringValue(s));
}