Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c8989e15
Kaydet (Commit)
c8989e15
authored
Agu 07, 2011
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleanup/remove CommandLine-related methods in lngconvex.
üst
57cf0267
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
119 deletions
+4
-119
cmdline.cxx
shell/source/tools/lngconvex/cmdline.cxx
+3
-74
cmdline.hxx
shell/source/tools/lngconvex/cmdline.hxx
+1
-41
unusedcode.easy
unusedcode.easy
+0
-4
No files found.
shell/source/tools/lngconvex/cmdline.cxx
Dosyayı görüntüle @
c8989e15
...
@@ -40,10 +40,9 @@
...
@@ -40,10 +40,9 @@
// Creation
// Creation
CommandLine
::
CommandLine
(
size_t
argc
,
char
*
argv
[]
,
const
std
::
string
&
ArgPrefix
)
:
CommandLine
::
CommandLine
(
size_t
argc
,
char
*
argv
[])
:
m_argc
(
argc
),
m_argc
(
argc
),
m_argv
(
argv
),
m_argv
(
argv
)
m_argprefix
(
ArgPrefix
)
{
{
}
}
...
@@ -51,57 +50,6 @@ CommandLine::CommandLine(size_t argc, char* argv[], const std::string& ArgPrefix
...
@@ -51,57 +50,6 @@ CommandLine::CommandLine(size_t argc, char* argv[], const std::string& ArgPrefix
// Query
// Query
/** Return the argument count
*/
size_t
CommandLine
::
get_arg_count
()
const
{
return
m_argc
;
}
/** Return an argument by index
This method doesn't skip argument
names if any, so if the second
argument is an argument name the
function nevertheless returns it.
@precond 0 <= Index < GetArgumentCount
@throws std::out_of_range exception
if the given index is to high
*/
std
::
string
CommandLine
::
get_arg
(
size_t
Index
)
const
{
OSL_PRECOND
(
Index
<
m_argc
,
"Index out of range"
);
if
(
Index
>
(
m_argc
-
1
))
throw
std
::
out_of_range
(
"Invalid index"
);
return
m_argv
[
Index
];
}
/** Returns all argument name found in the
command line. An argument will be identified
by a specified prefix. The standard prefix
is '-'.
If the are no argument names the returned
container is empty.
*/
StringListPtr_t
CommandLine
::
get_arg_names
()
const
{
StringListPtr_t
arg_cont
(
new
StringList_t
());
for
(
size_t
i
=
0
;
i
<
m_argc
;
i
++
)
{
std
::
string
argn
=
m_argv
[
i
];
if
(
is_arg_name
(
argn
))
arg_cont
->
push_back
(
argn
);
}
return
arg_cont
;
}
/** Returns an argument by name. If there are
/** Returns an argument by name. If there are
duplicate argument names in the command line,
duplicate argument names in the command line,
the first one wins.
the first one wins.
...
@@ -143,30 +91,11 @@ std::string CommandLine::get_arg(const std::string& ArgumentName) const
...
@@ -143,30 +91,11 @@ std::string CommandLine::get_arg(const std::string& ArgumentName) const
// Command
// Command
/** Set the prefix used to identify arguments in
the command line.
@precond prefix is not empty
@throws std::invalid_argument exception if
the prefix is empty
*/
void
CommandLine
::
set_arg_prefix
(
const
std
::
string
&
Prefix
)
{
OSL_PRECOND
(
Prefix
.
length
(),
"Empty argument prefix!"
);
if
(
0
==
Prefix
.
length
())
throw
std
::
invalid_argument
(
"Empty argument prefix not allowed"
);
m_argprefix
=
Prefix
;
}
/** Returns whether a given argument is an argument name
/** Returns whether a given argument is an argument name
*/
*/
bool
CommandLine
::
is_arg_name
(
const
std
::
string
&
Argument
)
const
bool
CommandLine
::
is_arg_name
(
const
std
::
string
&
Argument
)
const
{
{
return
(
0
==
Argument
.
compare
(
0
,
m_argprefix
.
length
(),
m_argprefix
)
);
return
(
Argument
.
length
()
>
0
&&
Argument
[
0
]
==
'-'
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
shell/source/tools/lngconvex/cmdline.hxx
Dosyayı görüntüle @
c8989e15
...
@@ -15,38 +15,12 @@ public:
...
@@ -15,38 +15,12 @@ public:
// Creation
// Creation
CommandLine
(
size_t
argc
,
char
*
argv
[]
,
const
std
::
string
&
ArgPrefix
=
std
::
string
(
"-"
)
);
CommandLine
(
size_t
argc
,
char
*
argv
[]);
// Query
// Query
/** Return the argument count
*/
size_t
get_arg_count
()
const
;
/** Return an argument by index
This method doesn't skip argument
names if any, so if the second
argument is an argument name the
function nevertheless returns it.
@precond 0 <= Index < GetArgumentCount
@throws std::out_of_range exception
if the given index is to high
*/
std
::
string
get_arg
(
size_t
Index
)
const
;
/** Returns all argument name found in the
command line. An argument will be identified
by a specified prefix. The standard prefix
is '-'.
If there are no argument names the returned
container is empty.
*/
StringListPtr_t
get_arg_names
()
const
;
/** Returns an argument by name. If there are
/** Returns an argument by name. If there are
duplicate argument names in the command line,
duplicate argument names in the command line,
the first one wins.
the first one wins.
...
@@ -66,19 +40,6 @@ public:
...
@@ -66,19 +40,6 @@ public:
std
::
string
get_arg
(
const
std
::
string
&
ArgumentName
)
const
;
std
::
string
get_arg
(
const
std
::
string
&
ArgumentName
)
const
;
// Command
/** Set the prefix used to identify arguments in
the command line.
@precond prefix is not empty
@throws std::invalid_argument exception if
the prefix is empty
*/
void
set_arg_prefix
(
const
std
::
string
&
Prefix
);
private
:
private
:
/** Returns whether a given argument is an argument name
/** Returns whether a given argument is an argument name
...
@@ -88,7 +49,6 @@ private:
...
@@ -88,7 +49,6 @@ private:
private
:
private
:
size_t
m_argc
;
size_t
m_argc
;
char
**
m_argv
;
char
**
m_argv
;
std
::
string
m_argprefix
;
// prevent copy and assignment
// prevent copy and assignment
private
:
private
:
...
...
unusedcode.easy
Dosyayı görüntüle @
c8989e15
...
@@ -138,10 +138,6 @@ ComboBox::IsDDAutoWidthEnabled() const
...
@@ -138,10 +138,6 @@ ComboBox::IsDDAutoWidthEnabled() const
ComboBox::IsUserDrawEnabled() const
ComboBox::IsUserDrawEnabled() const
ComboBox::ShowProminentEntry(unsigned short)
ComboBox::ShowProminentEntry(unsigned short)
CommandExtTextInputData::CommandExtTextInputData()
CommandExtTextInputData::CommandExtTextInputData()
CommandLine::get_arg(unsigned long) const
CommandLine::get_arg_count() const
CommandLine::get_arg_names() const
CommandLine::set_arg_prefix(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
CommunicationLinkList::DeleteAndDestroy(unsigned short, unsigned short)
CommunicationLinkList::DeleteAndDestroy(unsigned short, unsigned short)
CommunicationLinkList::Insert(CommunicationLink const*&, unsigned short&)
CommunicationLinkList::Insert(CommunicationLink const*&, unsigned short&)
CommunicationLinkList::Insert(CommunicationLink const**, unsigned short)
CommunicationLinkList::Insert(CommunicationLink const**, unsigned short)
...
...
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