vsg::write with the vsg::Path? #615
Answered
by
robertosfield
albert8271
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi,
On Tue, 29 Nov 2022 at 02:52, 郭正红 ***@***.***> wrote:
I write a file with the vsg::write and the vsg::VSG, the code is below.
When using the vsg::Path as a parameter, the process is failure ,but using
the ofstream as a parameter, the process is right.
I don't know Why? ask for Help. thank you !
vsg::VSG io;
std::ofstream file1;
file1.open("out.txt");
io.write(object, file1); //correct
vsg::write(object,vsg::Path("path.txt")); //can't write a fileMessage ID:
***@***.***>
The file extension for native ascii text files is .vsgt, it will reject
.txt as not being suitable.
The ostream without an option will succeed as the writer doesn't know
whether it's suitable or not so assumes it is. If you you provide an
Options object then it can determine the extension to assume and do the
check.
Cheers,
Robert.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
albert8271
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello, guys
I write a file with the vsg::write and the vsg::VSG, the code is below.
When using the vsg::Path as a parameter, the process is failure ,but using the ofstream as a parameter, the process is right.
I don't know Why? ask for Help. thank you !
vsg::VSG io;
std::ofstream file1;
file1.open("out.txt");
io.write(object, file1); //correct
vsg::write(object,vsg::Path("path.txt")); //can't write a file
Beta Was this translation helpful? Give feedback.
All reactions