Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F3995612
main.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 7, 4:47 PM
Size
1 KB
Mime Type
text/x-c++
Expires
Thu, Jul 9, 4:47 PM (1 d, 6 h)
Engine
blob
Format
Raw Data
Handle
268867
Attached To
rXR Xreate
main.cpp
View Options
#include <iostream>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TTransportUtils.h>
#include "gen-cpp/PhabricatorParserPrivate.h"
using namespace std;
using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
int main() {
boost::shared_ptr<TTransport> socket(new TSocket("/tmp/phabricator-parser"));
boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
PhabricatorParserPrivateClient client(protocol);
string text =
"= Large Header = \n \
\n\
== Smaller Header == \n\
\n\
## This is a Header As Well\n\
\n\
Also a Large Header \n\
=================== \n\
\n\
Also a Smaller Header \n\
---------------------";
try {
transport->open();
for (int i=0; i<answer.size(); ++i){
Block b = answer[i];
cout << b.start << " " << b.num_lines << " " << b.rule << endl;
}
cout << answer.size();
} catch (TException& tx) {
cout << "ERROR: " << tx.what() << endl;
}
}
Event Timeline
Log In to Comment