455 |
return vs; |
return vs; |
456 |
} |
} |
457 |
|
|
|
class NetEnv { |
|
|
private: |
|
|
int ok; |
|
|
public: |
|
|
NetEnv() { |
|
|
ok = est_init_net_env(); |
|
|
if (! ok) throw IOError("can't init net env"); |
|
|
} |
|
|
~NetEnv() { |
|
|
est_free_net_env(); |
|
|
} |
|
|
}; |
|
|
|
|
458 |
class NodeDocument { |
class NodeDocument { |
459 |
private: |
private: |
460 |
ESTRESDOC *rdoc; |
ESTRESDOC *rdoc; |
513 |
class Node { |
class Node { |
514 |
private: |
private: |
515 |
ESTNODE *node; |
ESTNODE *node; |
516 |
|
int netenv_ok; |
517 |
public: |
public: |
518 |
Node(const char *url) { |
Node(const char *url) { |
519 |
|
netenv_ok = est_init_net_env(); |
520 |
|
if (! netenv_ok) throw IOError("can't init net env"); |
521 |
node = est_node_new(url); |
node = est_node_new(url); |
522 |
if (! node) throw IOError("can't create node"); |
if (! node) throw IOError("can't create node"); |
523 |
} |
} |
524 |
~Node() { |
~Node() { |
525 |
est_node_delete(node); |
est_node_delete(node); |
526 |
|
est_free_net_env(); |
527 |
} |
} |
528 |
void set_proxy(const char *host, int port) { |
void set_proxy(const char *host, int port) { |
529 |
est_node_set_proxy(node, host, port); |
est_node_set_proxy(node, host, port); |