1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "ucpext_content.hxx"
#include "ucpext_provider.hxx"
#include "ucpext_resultset.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/lang/IllegalAccessException.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
#include <com/sun/star/ucb/XPersistentPropertySet.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
#include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
#include <com/sun/star/ucb/XDynamicResultSet.hpp>
#include <com/sun/star/deployment/PackageInformationProvider.hpp>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/propertyvalueset.hxx>
#include <ucbhelper/cancelcommandexecution.hxx>
#include <ucbhelper/content.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/uri.hxx>
#include <sal/macros.h>
#include <algorithm>
namespace ucb { namespace ucp { namespace ext
{
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Type;
using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::ucb::XContentIdentifier;
using ::com::sun::star::ucb::IllegalIdentifierException;
using ::com::sun::star::ucb::XContent;
using ::com::sun::star::ucb::XCommandEnvironment;
using ::com::sun::star::ucb::Command;
using ::com::sun::star::ucb::CommandAbortedException;
using ::com::sun::star::beans::Property;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::ucb::OpenCommandArgument2;
using ::com::sun::star::ucb::XDynamicResultSet;
using ::com::sun::star::ucb::UnsupportedOpenModeException;
using ::com::sun::star::io::XOutputStream;
using ::com::sun::star::io::XActiveDataSink;
using ::com::sun::star::io::XInputStream;
using ::com::sun::star::ucb::UnsupportedDataSinkException;
using ::com::sun::star::ucb::UnsupportedCommandException;
using ::com::sun::star::sdbc::XRow;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::PropertyChangeEvent;
using ::com::sun::star::lang::IllegalAccessException;
using ::com::sun::star::ucb::CommandInfo;
using ::com::sun::star::deployment::PackageInformationProvider;
using ::com::sun::star::deployment::XPackageInformationProvider;
namespace OpenMode = ::com::sun::star::ucb::OpenMode;
namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
//= helper
namespace
{
OUString lcl_compose( const OUString& i_rBaseURL, const OUString& i_rRelativeURL )
{
ENSURE_OR_RETURN( !i_rBaseURL.isEmpty(), "illegal base URL", i_rRelativeURL );
OUStringBuffer aComposer( i_rBaseURL );
if ( !i_rBaseURL.endsWith("/") )
aComposer.append( '/' );
aComposer.append( i_rRelativeURL );
return aComposer.makeStringAndClear();
}
struct SelectPropertyName : public ::std::unary_function< Property, OUString >
{
const OUString& operator()( const Property& i_rProperty ) const
{
return i_rProperty.Name;
}
};
}
//= Content
Content::Content( const Reference< XComponentContext >& rxContext, ::ucbhelper::ContentProviderImplHelper* i_pProvider,
const Reference< XContentIdentifier >& i_rIdentifier )
:Content_Base( rxContext, i_pProvider, i_rIdentifier )
,m_eExtContentType( E_UNKNOWN )
,m_aIsFolder()
,m_aContentType()
,m_sExtensionId()
,m_sPathIntoExtension()
{
const OUString sURL( getIdentifier()->getContentIdentifier() );
if ( denotesRootContent( sURL ) )
{
m_eExtContentType = E_ROOT;
}
else
{
const OUString sRelativeURL( sURL.copy( ContentProvider::getRootURL().getLength() ) );
const sal_Int32 nSepPos = sRelativeURL.indexOf( '/' );
if ( ( nSepPos == -1 ) || ( nSepPos == sRelativeURL.getLength() - 1 ) )
{
m_eExtContentType = E_EXTENSION_ROOT;
}
else
{
m_eExtContentType = E_EXTENSION_CONTENT;
}
}
if ( m_eExtContentType != E_ROOT )
{
const OUString sRootURL = ContentProvider::getRootURL();
m_sExtensionId = sURL.copy( sRootURL.getLength() );
const sal_Int32 nNextSep = m_sExtensionId.indexOf( '/' );
if ( nNextSep > -1 )
{
m_sPathIntoExtension = m_sExtensionId.copy( nNextSep + 1 );
m_sExtensionId = m_sExtensionId.copy( 0, nNextSep );
}
m_sExtensionId = Content::decodeIdentifier( m_sExtensionId );
}
}
Content::~Content()
{
}
OUString SAL_CALL Content::getImplementationName() throw( RuntimeException, std::exception )
{
return OUString( "org.openoffice.comp.ucp.ext.Content" );
}
Sequence< OUString > SAL_CALL Content::getSupportedServiceNames() throw( RuntimeException, std::exception )
{
Sequence< OUString > aServiceNames(2);
aServiceNames[0] = "com.sun.star.ucb.Content";
aServiceNames[1] = "com.sun.star.ucb.ExtensionContent";
return aServiceNames;
}
OUString SAL_CALL Content::getContentType() throw( RuntimeException, std::exception )
{
impl_determineContentType();
return *m_aContentType;
}
Any SAL_CALL Content::execute( const Command& aCommand, sal_Int32 /* CommandId */, const Reference< XCommandEnvironment >& i_rEvironment )
throw( Exception, CommandAbortedException, RuntimeException, std::exception )
{
Any aRet;
if ( aCommand.Name == "getPropertyValues" )
{
Sequence< Property > Properties;
if ( !( aCommand.Argument >>= Properties ) )
{
::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
OUString(), *this, -1 ) ),
i_rEvironment );
// unreachable
}
aRet <<= getPropertyValues( Properties, i_rEvironment );
}
else if ( aCommand.Name == "setPropertyValues" )
{
Sequence< PropertyValue > aProperties;
if ( !( aCommand.Argument >>= aProperties ) )
{
::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
OUString(), *this, -1 ) ),
i_rEvironment );
// unreachable
}
if ( !aProperties.getLength() )
{
::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
OUString(), *this, -1 ) ),
i_rEvironment );
// unreachable
}
aRet <<= setPropertyValues( aProperties, i_rEvironment );
}
else if ( aCommand.Name == "getPropertySetInfo" )
{
// implemented by base class.
aRet <<= getPropertySetInfo( i_rEvironment );
}
else if ( aCommand.Name == "getCommandInfo" )
{
// implemented by base class.
aRet <<= getCommandInfo( i_rEvironment );
}
else if ( aCommand.Name == "open" )
{
OpenCommandArgument2 aOpenCommand;
if ( !( aCommand.Argument >>= aOpenCommand ) )
{
::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
OUString(), *this, -1 ) ),
i_rEvironment );
// unreachable
}
bool bOpenFolder =
( ( aOpenCommand.Mode == OpenMode::ALL ) ||
( aOpenCommand.Mode == OpenMode::FOLDERS ) ||
( aOpenCommand.Mode == OpenMode::DOCUMENTS ) );
if ( bOpenFolder && impl_isFolder() )
{
Reference< XDynamicResultSet > xSet = new ResultSet( m_xContext, this, aOpenCommand, i_rEvironment );
aRet <<= xSet;
}
if ( aOpenCommand.Sink.is() )
{
const OUString sPhysicalContentURL( getPhysicalURL() );
::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEvironment, m_xContext );
aRet = aRequestedContent.executeCommand( OUString( "open" ), makeAny( aOpenCommand ) );
}
}
else
{
::ucbhelper::cancelCommandExecution( makeAny( UnsupportedCommandException(
OUString(), *this ) ),
i_rEvironment );
// unreachable
}
return aRet;
}
void SAL_CALL Content::abort( sal_Int32 ) throw( RuntimeException, std::exception )
{
}
OUString Content::encodeIdentifier( const OUString& i_rIdentifier )
{
return ::rtl::Uri::encode( i_rIdentifier, rtl_UriCharClassRegName, rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8 );
}
OUString Content::decodeIdentifier( const OUString& i_rIdentifier )
{
return ::rtl::Uri::decode( i_rIdentifier, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
}
bool Content::denotesRootContent( const OUString& i_rContentIdentifier )
{
const OUString sRootURL( ContentProvider::getRootURL() );
if ( i_rContentIdentifier == sRootURL )
return true;
// the root URL contains only two trailing /, but we also recognize 3 of them as denoting the root URL
if ( i_rContentIdentifier.match( sRootURL )
&& ( i_rContentIdentifier.getLength() == sRootURL.getLength() + 1 )
&& ( i_rContentIdentifier[ i_rContentIdentifier.getLength() - 1 ] == '/' )
)
return true;
return false;
}
OUString Content::getParentURL()
{
const OUString sRootURL( ContentProvider::getRootURL() );
switch ( m_eExtContentType )
{
case E_ROOT:
// don't have a parent
return sRootURL;
case E_EXTENSION_ROOT:
// our parent is the root itself
return sRootURL;
case E_EXTENSION_CONTENT:
{
const OUString sURL = m_xIdentifier->getContentIdentifier();
// cut the root URL
if ( !sURL.match( sRootURL, 0 ) )
{
SAL_INFO( "ucb.ucp.ext", "illegal URL structure - no root" );
break;
}
OUString sRelativeURL( sURL.copy( sRootURL.getLength() ) );
// cut the extension ID
const OUString sSeparatedExtensionId( encodeIdentifier( m_sExtensionId ) + OUString( '/' ) );
if ( !sRelativeURL.match( sSeparatedExtensionId ) )
{
SAL_INFO( "ucb.ucp.ext", "illegal URL structure - no extension ID" );
break;
}
sRelativeURL = sRelativeURL.copy( sSeparatedExtensionId.getLength() );
// cut the final slash (if any)
if ( sRelativeURL.isEmpty() )
{
SAL_INFO( "ucb.ucp.ext", "illegal URL structure - ExtensionContent should have a level below the extension ID" );
break;
}
if ( sRelativeURL.endsWith("/") )
sRelativeURL = sRelativeURL.copy( 0, sRelativeURL.getLength() - 1 );
// remove the last segment
const sal_Int32 nLastSep = sRelativeURL.lastIndexOf( '/' );
sRelativeURL = sRelativeURL.copy( 0, nLastSep != -1 ? nLastSep : 0 );
OUStringBuffer aComposer;
aComposer.append( sRootURL );
aComposer.append( sSeparatedExtensionId );
aComposer.append( sRelativeURL );
return aComposer.makeStringAndClear();
}
default:
OSL_FAIL( "Content::getParentURL: unhandled case!" );
break;
}
return OUString();
}
Reference< XRow > Content::getArtificialNodePropertyValues( const Reference< XComponentContext >& rxContext,
const Sequence< Property >& i_rProperties, const OUString& i_rTitle )
{
// note: empty sequence means "get values of all supported properties".
::rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( rxContext );
const sal_Int32 nCount = i_rProperties.getLength();
if ( nCount )
{
Reference< XPropertySet > xAdditionalPropSet;
const Property* pProps = i_rProperties.getConstArray();
for ( sal_Int32 n = 0; n < nCount; ++n )
{
const Property& rProp = pProps[ n ];
// Process Core properties.
if ( rProp.Name == "ContentType" )
{
xRow->appendString ( rProp, ContentProvider::getArtificialNodeContentType() );
}
else if ( rProp.Name == "Title" )
{
xRow->appendString ( rProp, i_rTitle );
}
else if ( rProp.Name == "IsDocument" )
{
xRow->appendBoolean( rProp, false );
}
else if ( rProp.Name == "IsFolder" )
{
xRow->appendBoolean( rProp, true );
}
else
{
// append empty entry.
xRow->appendVoid( rProp );
}
}
}
else
{
// Append all Core Properties.
xRow->appendString ( Property( OUString("ContentType"),
-1,
cppu::UnoType<OUString>::get(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
ContentProvider::getArtificialNodeContentType() );
xRow->appendString ( Property( OUString("Title"),
-1,
cppu::UnoType<OUString>::get(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
i_rTitle );
xRow->appendBoolean( Property( OUString("IsDocument"),
-1,
getCppuBooleanType(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
false );
xRow->appendBoolean( Property( OUString("IsFolder"),
-1,
getCppuBooleanType(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY ),
true );
}
return Reference< XRow >( xRow.get() );
}
OUString Content::getPhysicalURL() const
{
ENSURE_OR_RETURN( m_eExtContentType != E_ROOT, "illegal call", OUString() );
// create an ucb::XContent for the physical file within the deployed extension
const Reference< XPackageInformationProvider > xPackageInfo = PackageInformationProvider::get(m_xContext);
const OUString sPackageLocation( xPackageInfo->getPackageLocation( m_sExtensionId ) );
if ( m_sPathIntoExtension.isEmpty() )
return sPackageLocation;
return lcl_compose( sPackageLocation, m_sPathIntoExtension );
}
Reference< XRow > Content::getPropertyValues( const Sequence< Property >& i_rProperties, const Reference< XCommandEnvironment >& i_rEnv )
{
::osl::Guard< ::osl::Mutex > aGuard( m_aMutex );
switch ( m_eExtContentType )
{
case E_ROOT:
return getArtificialNodePropertyValues( m_xContext, i_rProperties, ContentProvider::getRootURL() );
case E_EXTENSION_ROOT:
return getArtificialNodePropertyValues( m_xContext, i_rProperties, m_sExtensionId );
case E_EXTENSION_CONTENT:
{
const OUString sPhysicalContentURL( getPhysicalURL() );
::ucbhelper::Content aRequestedContent( sPhysicalContentURL, i_rEnv, m_xContext );
// translate the property request
Sequence< OUString > aPropertyNames( i_rProperties.getLength() );
::std::transform(
i_rProperties.getConstArray(),
i_rProperties.getConstArray() + i_rProperties.getLength(),
aPropertyNames.getArray(),
SelectPropertyName()
);
const Sequence< Any > aPropertyValues = aRequestedContent.getPropertyValues( aPropertyNames );
const ::rtl::Reference< ::ucbhelper::PropertyValueSet > xValueRow = new ::ucbhelper::PropertyValueSet( m_xContext );
sal_Int32 i=0;
for ( const Any* value = aPropertyValues.getConstArray();
value != aPropertyValues.getConstArray() + aPropertyValues.getLength();
++value, ++i
)
{
xValueRow->appendObject( aPropertyNames[i], *value );
}
return xValueRow.get();
}
default:
OSL_FAIL( "Content::getPropertyValues: unhandled case!" );
break;
}
OSL_FAIL( "Content::getPropertyValues: unreachable!" );
return NULL;
}
Sequence< Any > Content::setPropertyValues( const Sequence< PropertyValue >& i_rValues, const Reference< XCommandEnvironment >& /* xEnv */)
{
::osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
Sequence< Any > aRet( i_rValues.getLength() );
PropertyChangeEvent aEvent;
aEvent.Source = static_cast< cppu::OWeakObject * >( this );
aEvent.Further = sal_False;
aEvent.PropertyHandle = -1;
const PropertyValue* pValues = i_rValues.getConstArray();
const sal_Int32 nCount = i_rValues.getLength();
for ( sal_Int32 n = 0; n < nCount; ++n, ++pValues )
{
// all our properties are read-only ...
aRet[ n ] <<= IllegalAccessException("property is read-only.", *this );
}
return aRet;
}
Sequence< CommandInfo > Content::getCommands( const Reference< XCommandEnvironment > & /*xEnv*/ )
{
sal_uInt32 nCommandCount = 5;
static const CommandInfo aCommandInfoTable[] =
{
// Mandatory commands
CommandInfo(
OUString( "getCommandInfo" ),
-1,
getCppuVoidType()
),
CommandInfo(
OUString( "getPropertySetInfo" ),
-1,
getCppuVoidType()
),
CommandInfo(
OUString( "getPropertyValues" ),
-1,
getCppuType(
static_cast< Sequence< Property > * >( 0 ) )
),
CommandInfo(
OUString( "setPropertyValues" ),
-1,
getCppuType(
static_cast< Sequence< PropertyValue > * >( 0 ) )
)
// Optional standard commands
, CommandInfo(
OUString( "open" ),
-1,
cppu::UnoType<OpenCommandArgument2>::get()
)
};
return Sequence< CommandInfo >( aCommandInfoTable, nCommandCount );
}
Sequence< Property > Content::getProperties( const Reference< XCommandEnvironment > & /*xEnv*/ )
{
static const Property aProperties[] =
{
Property(
OUString( "ContentType" ),
-1,
cppu::UnoType<OUString>::get(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY
),
Property(
OUString( "IsDocument" ),
-1,
getCppuBooleanType(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY
),
Property(
OUString( "IsFolder" ),
-1,
getCppuBooleanType(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY
),
Property(
OUString( "Title" ),
-1,
cppu::UnoType<OUString>::get(),
PropertyAttribute::BOUND | PropertyAttribute::READONLY
)
};
return Sequence< Property >( aProperties, sizeof( aProperties ) / sizeof( aProperties[0] ) );
}
bool Content::impl_isFolder()
{
if ( !!m_aIsFolder )
return *m_aIsFolder;
bool bIsFolder = false;
try
{
Sequence< Property > aProps(1);
aProps[0].Name = "IsFolder";
Reference< XRow > xRow( getPropertyValues( aProps, NULL ), UNO_SET_THROW );
bIsFolder = xRow->getBoolean(1);
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
m_aIsFolder.reset( bIsFolder );
return *m_aIsFolder;
}
void Content::impl_determineContentType()
{
if ( !!m_aContentType )
return;
m_aContentType.reset( ContentProvider::getArtificialNodeContentType() );
if ( m_eExtContentType == E_EXTENSION_CONTENT )
{
try
{
Sequence< Property > aProps(1);
aProps[0].Name = "ContentType";
Reference< XRow > xRow( getPropertyValues( aProps, NULL ), UNO_SET_THROW );
m_aContentType.reset( xRow->getString(1) );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
}
}
} } } // namespace ucp::ext
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|