Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7d1e003a
Commit
7d1e003a
authored
Oct 15, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/syntax: add a "Quoting and escaping" section
parent
b4e62651
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
3 deletions
+75
-3
syntax.texi
doc/syntax.texi
+75
-3
No files found.
doc/syntax.texi
View file @
7d1e003a
@chapter Syntax
@c man begin SYNTAX
When evaluating specific formats, FFmpeg uses internal library parsing
functions, shared by the tools. This section documents the syntax of
some of these formats.
This section documents the syntax and formats employed by the FFmpeg
libraries and tools.
@anchor{quoting_and_escaping}
@section Quoting and escaping
FFmpeg adopts the following quoting and escaping mechanism, unless
explicitly specified. The following rules are applied:
@itemize
@item
@code{'} and @code{\} are special characters (respectively used for
quoting and escaping). In addition to them, there might be other
special characters depending on the specific syntax where the escaping
and quoting are employed.
@item
A special character is escaped by prefixing it with a '\'.
@item
All characters enclosed between '' are included literally in the
parsed string. The quote character @code{'} itself cannot be quoted,
so you may need to close the quote and escape it.
@item
Leading and trailing whitespaces, unless escaped or quoted, are
removed from the parsed string.
@end itemize
Note that you may need to add a second level of escaping when using
the command line or a script, which depends on the syntax of the
adopted shell language.
The function @code{av_get_token} defined in
@file{libavutil/avstring.h} can be used to parse a token quoted or
escaped according to the rules defined above.
The tool @file{tools/ffescape} in the FFmpeg source tree can be used
to automatically quote or escape a string in a script.
@subsection Examples
@itemize
@item
Escape the string @code{Crime d'Amour} containing the @code{'} special
character:
@example
Crime d\'Amour
@end example
@item
The string above contains a quote, so the @code{'} needs to be escaped
when quoting it:
@example
'Crime d'\''Amour'
@end example
@item
Include leading or trailing whitespaces using quoting:
@example
' this string starts and ends with whitespaces '
@end example
@item
Escaping and quoting can be mixed together:
@example
' The string '\'string\'' is a string '
@end example
@item
To include a literal @code{\} you can use either escaping or quoting:
@example
'c:\foo' can be written as c:\\foo
@end example
@end itemize
@anchor{date syntax}
@section Date
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment