










可以和林锐博士的规范配合起来使用,哈哈!
int main()
{
return 0;
}
int main()
{
return 0;
}
// Document.h
namespace WebCore {
class Document {
Document();
...
};
} // namespace WebCore
// Document.h
namespace WebCore {
class Document {
Document();
...
};
} // namespace WebCore
// Document.cpp
namespace WebCore {
Document::Document()
{
...
}
} // namespace WebCore
// Document.cpp
namespace WebCore {
Document::Document()
{
...
}
} // namespace WebCore
switch (condition) {
case fooCondition:
case barCondition:
i++;
break;
default:
i--;
}
switch (condition) {
case fooCondition:
case barCondition:
i++;
break;
default:
i--;
}
return attr->name() == srcAttr
|| attr->name() == lowsrcAttr
|| (attr->name() == usemapAttr && attr->value().domString()[0] != '#');
return attr->name() == srcAttr ||
attr->name() == lowsrcAttr ||
(attr->name() == usemapAttr && attr->value().domString()[0] != '#');
i++;
i ++;
y = m * x + b; f(a, b); c = a | b; return condition ? 1 : 0;
y=m*x+b; f(a,b); c = a|b; return condition ? 1:0;
if (condition)
doIt();
if(condition)
doIt();
f(a, b);
f (a, b); f( a, b );
x++;
y++;
if (condition)
doIt();
x++; y++; if (condition) doIt();
else statement should go on the same line as a preceding close brace.
if (condition) {
...
} else {
...
}
if (condition) {
...
}
else {
...
}
else if statement should be written as an if statement when the prior if concludes with a return statement.
if (condition) {
...
return someValue;
}
if (condition) {
...
}
if (condition) {
...
return someValue;
} else if (condition) {
...
}
int main()
{
...
}
int main() {
...
}
class MyClass {
...
};
namespace WebCore {
...
}
for (int i = 0; i < 10; i++) {
...
}
class MyClass
{
...
};
if (condition)
doIt();
if (condition) {
doIt();
}
for ( ; current; current = current->next) { }
for ( ; current; current = current->next);
0. In C, it should be written as NULL. In Objective-C and Objective-C++, follow the guideline for C or C++, respectively, but use nil to represent a null Objective-C object.bool values should be written as true and false. Objective-C BOOL values should be written as YES and NO.if (condition)
doIt();
if (!ptr)
return;
if (!count)
return;
if (condition == true)
doIt();
if (ptr == NULL)
return;
if (count == 0)
return;
struct Data; size_t bufferSize; class HTMLDocument; String mimeType();
struct data; size_t buffer_size; class HtmlDocument; String MIMEType();
size_t characterSize; size_t length; short tabIndex; // more canonical
size_t charSize; size_t len; short tabulationIndex; // bizarre
class String {
...
short m_length;
};
class String {
...
short length;
};
@class String
...
short _length;
@end
@class String
...
short length;
@end
bool isValid; bool didSendData;
bool valid; bool sentData;
void setCount(size_t); // sets m_count size_t count(); // returns m_count
void setCount(size_t); // sets m_theCount size_t getCount();
bool convertToASCII(short*, size_t);
bool toASCII(short*, size_t);
void setCount(size_t);
void setCount(size_t count);
#define WBStopButtonTitle() \
NSLocalizedString(@"Stop", @"Stop button title")
#define WB_STOP_BUTTON_TITLE \
NSLocalizedString(@"Stop", @"Stop button title")
#define WBStopButtontitle \
NSLocalizedString(@"Stop", @"Stop button title")
// HTMLDocument.h #ifndef HTMLDocument_h #define HTMLDocument_h
// HTMLDocument.h #ifndef _HTML_DOCUMENT_H_ #define _HTML_DOCUMENT_H_
MyClass::MyClass(Document* doc)
: MySuperClass()
, m_myMember(0)
, m_doc(doc)
{
}
MyOtherClass::MyOtherClass()
: MySuperClass()
{
}
MyClass::MyClass(Document* doc) : MySuperClass()
{
m_myMember = 0;
m_doc = doc;
}
MyOtherClass::MyOtherClass() : MySuperClass() {}
Image* SVGStyledElement::doSomething(PaintInfo& paintInfo)
{
SVGStyledElement* element = static_cast<SVGStyledElement*>(node());
const KCDashArray& dashes = dashArray();
Image *SVGStyledElement::doSomething(PaintInfo &paintInfo)
{
SVGStyledElement *element = static_cast<SVGStyledElement *>(node());
const KCDashArray &dashes = dashArray();
// RenderLayer.h #include "Node.h" #include "RenderObject.h" #include "RenderView.h"
// RenderLayer.h #include "config.h" #include "RenderObject.h" #include "RenderView.h" #include "Node.h"
// HTMLDivElement.cpp #include "config.h" #include "HTMLDivElement.h" #include "Attribute.h" #include "HTMLElement.h" #include "QualifiedName.h"
// HTMLDivElement.cpp #include "HTMLElement.h" #include "HTMLDivElement.h" #include "QualifiedName.h" #include "Attribute.h"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。