25#include <osl/diagnose.h>
26#include <osl/thread.h>
27#include <rtl/character.hxx>
36"\tvoid| char| int| float| double|",
37"\tUINT16| INT16| UINT32| INT32| BOOL|",
38"\tBYTE| String| SbxObject",
40"{ import \"filename\" }\n",
43"\tunique id range (ask MM)",
46"\tSlotIdFile( \"filename\" )",
49"\t{ include \"filename\" }\n",
52"\titem type item-name;\n",
57"\t\t{ type identifier }",
65"\ttypedef type identifier\n",
68"\t( { item parameter-name SLOT_ID } )\n",
71"\titem identifier SLOT_ID [ item-method-args ]",
73"\t\tAccelConfig, MenuConfig, ToolbarConfig",
76"\t\tExecMethod = Identifier",
78"\t\tGroupId = Identifier",
80"\t\tRecordPerSet*, RecordPerItem, NoRecord",
82"\t\tStateMethod = Identifier",
87"\tinterface definition:",
88"\tshell | interface identifier ':' interface",
92"---syntax example is sfx.idl---\n",
97"-fm<makefile target file>\n"
98"-help, ? @<file> response file\n"
111 for(
size_t n = 0;
n < rCommand.aInFileList.size(); ++
n )
113 OUString aFileName ( rCommand.aInFileList[
n ] );
128static bool ResponseFile( std::vector<OUString> * pList,
int argc,
char ** argv )
131 pList->push_back( OStringToOUString(*argv, osl_getThreadTextEncoding()) );
132 for(
int i = 1;
i < argc;
i++ )
134 if(
'@' == **(argv +
i) )
137 OStringToOUString((*(argv +
i)) +1, osl_getThreadTextEncoding()),
138 StreamMode::STD_READ );
150 && rtl::isAsciiWhiteSpace(
151 static_cast<unsigned char>(
aStr[
n]) ) )
155 && !rtl::isAsciiWhiteSpace(
156 static_cast<unsigned char>(
aStr[
n]) ) )
159 pList->push_back( OStringToOUString(std::string_view(
aStr).substr(
nPos,
n -
nPos), RTL_TEXTENCODING_ASCII_US) );
164 pList->push_back( OStringToOUString( argv[
i ], osl_getThreadTextEncoding() ) );
172 std::vector<OUString> aList;
176 for(
size_t i = 1;
i < aList.size();
i++ )
178 OUString aParam( aList[ i ] );
180 if(
'-' == aFirstChar )
182 aParam = aParam.copy( 1 );
183 aFirstChar = aParam[0];
184 if( aFirstChar ==
'F' || aFirstChar ==
'f' )
186 aParam = aParam.copy( 1 );
187 aFirstChar = aParam[0];
188 OUString
aName( aParam.copy( 1 ) );
189 if(
's' == aFirstChar )
191 aSlotMapFile =
aName;
193 else if(
'm' == aFirstChar )
197 else if(
'x' == aFirstChar )
201 else if(
'M' == aFirstChar )
208 "unknown switch: %s\n",
210 aParam, RTL_TEXTENCODING_UTF8).getStr());
214 else if( aParam.equalsIgnoreAsciiCase(
"help" ) || aParam.equalsIgnoreAsciiCase(
"?" ) )
218 else if( aParam.equalsIgnoreAsciiCase(
"quiet" ) )
222 else if( aParam.equalsIgnoreAsciiCase(
"verbose" ) )
226 else if( aParam.equalsIgnoreAsciiCase(
"syntax" ) )
232 else if (aParam ==
"isystem")
235 if (i < aList.size())
240 else if (aParam.startsWith(
"isystem"))
244 else if( aParam.startsWithIgnoreAsciiCase(
"i" ) )
246 OUString
aName( aParam.copy( 1 ) );
247 if( !aPath.isEmpty() )
248 aPath += OUStringChar(SAL_PATHSEPARATOR);
251 else if( aParam.startsWithIgnoreAsciiCase(
"rsc" ) )
253 OSL_ENSURE(
false,
"does anything use this option, doesn't look like it belong here");
254 if( !aList[ i + 1 ].isEmpty() )
263 "unknown switch: %s\n",
265 aParam, RTL_TEXTENCODING_UTF8).getStr());
271 aInFileList.push_back( aParam );
282 auto const env = getenv(
"INCLUDE");
283 OString aInc(env ==
nullptr ?
"" : env);
285 if( aInc.getLength() )
287 if( !aPath.isEmpty() )
288 aPath += OUStringChar(SAL_PATHSEPARATOR);
289 aPath += OStringToOUString(aInc, RTL_TEXTENCODING_ASCII_US);
293SvCommand::~SvCommand()
std::unique_ptr< SvStringHashTable > pHashTable
std::unique_ptr< SvGlobalHashNames > pGlobalNames
SvCommand(const OUString &rCommand, const OUString &rArg)
void SetError(const SvIdlError &r)
void WriteError(SvTokenStream &rInStm)
void AddDepFile(OUString const &rFileName)
void ReadSvIdl(const OUString &rPath)
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
bool ReadIdl(SvIdlWorkingBase *pDataBase, const SvCommand &rCommand)
static bool ResponseFile(std::vector< OUString > *pList, int argc, char **argv)
char const CommandLineSyntax[]
char const *const SyntaxStrings[]
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > & env
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)