Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thrift include two files with same name?

I have this structure: (namespace is java)

package/common.thrift
common.thrift
fileA.thrift

I want fileA.thrift to include both common.thrift

include ".../package/common.thrift"
include "common.thrift"

struct A {
   1: common.Something something #From first file (no error)
   2: common.SomethingElse else  #This throws error.
}

Thrift only reads content from the file specified first in order. Is there a way for this : common.thrift as common So that i can differentiate them. Or the only solution is to have different file names

like image 778
phoenix Avatar asked Sep 14 '15 11:09

phoenix


1 Answers

Thrift only reads content from the file specified first in order

Not quite. But Thrift needs a prefix to access things that are included. Because the prefix is the file name, you cannot have two "common" files included without producing ambiguities.

Consequently, the answer to the question is no, you can't.

like image 59
JensG Avatar answered Sep 24 '22 03:09

JensG